Mercurial > hgrepos > Python > libs > ConfigMix
changeset 336:7692c91bb370
Tests: more thorough tests of identity and inverse quoting
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 07 May 2021 10:43:46 +0200 |
| parents | 97d47c5150d6 |
| children | 22b9dc539d6f |
| files | tests/test.py |
| diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test.py Fri May 07 10:36:47 2021 +0200 +++ b/tests/test.py Fri May 07 10:43:46 2021 +0200 @@ -782,8 +782,17 @@ self._cfg.getvar_s("events.qc-2021%x2e1-5G-summit.xref.%x23")) def test_quoting_and_unquoting_are_inverse(self): - for c in """abc09'"#:|%.{}[]/""": - self.assertEqual(c, self._cfg.unquote(self._cfg.quote(c))) + for c in """%.:#|"'{}[]""": + qc = self._cfg.quote(c) + self.assertTrue(qc.startswith("%x") and len(qc) == 4) + self.assertEqual(c, self._cfg.unquote(qc)) + + def test_quoting_and_unquoting_are_identical(self): + # other characters + for c in """abc09/""": + qc = self._cfg.quote(c) + self.assertEqual(c, qc) + self.assertEqual(c, self._cfg.unquote(qc)) def test_namespace_quoting(self): v1 = self._cfg.getvar("PY:version")
