Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/test.py @ 329:d81d2cdf4925
FIX: Handle the unquoting of namespaces within Configuration.getvar() properly.
BUGS: The "ref" namespace is handled specially and not yet compatible with
escaping some character of the "ref:" marker.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 07 May 2021 09:18:41 +0200 |
| parents | 30f8dce82850 |
| children | cbef412c841d |
comparison
equal
deleted
inserted
replaced
| 328:cffa4fcd0a4d | 329:d81d2cdf4925 |
|---|---|
| 783 | 783 |
| 784 def test_quoting_and_unquoting_are_inverse(self): | 784 def test_quoting_and_unquoting_are_inverse(self): |
| 785 for c in """abc09'"#:|%./""": | 785 for c in """abc09'"#:|%./""": |
| 786 self.assertEqual(c, self._cfg.unquote(self._cfg.quote(c))) | 786 self.assertEqual(c, self._cfg.unquote(self._cfg.quote(c))) |
| 787 | 787 |
| 788 def test_namespace_quoting(self): | |
| 789 v1 = self._cfg.getvar("PY:version") | |
| 790 v2 = self._cfg.getvar("P%x59:version") | |
| 791 v3 = self._cfg.getvar("%x50Y:version") | |
| 792 v4 = self._cfg.getvar("%x50%x59:version") | |
| 793 self.assertEqual(v1, v2) | |
| 794 self.assertEqual(v1, v3) | |
| 795 self.assertEqual(v1, v4) | |
| 788 | 796 |
| 789 if __name__ == "__main__": | 797 if __name__ == "__main__": |
| 790 unittest.main() | 798 unittest.main() |
