Mercurial > hgrepos > Python > libs > ConfigMix
changeset 738:20e3c2d956d9
More tests for nested filters
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 29 Oct 2023 11:36:25 +0100 |
| parents | 282c8e64d7b1 |
| children | 249196bd410a |
| files | tests/test.py |
| diffstat | 1 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test.py Sun Oct 29 11:32:56 2023 +0100 +++ b/tests/test.py Sun Oct 29 11:36:25 2023 +0100 @@ -2474,6 +2474,30 @@ u(os.path.join("a", "b", "d")), np) + def test_nested_filter_normpath_posixpath_2(self): + p1 = u(os.path.join("a", "b", "C", "d")) + cfg1 = { + u("path1"): p1, + u("path2"): u("{{|{{path1}}/../e|normpath,posixpath|}}") + } + cfg = cfg = configmix.config.Configuration(cfg1) + np = cfg.getvarl_s(u("path2")) + self.assertEqual( + u(os.path.join("a", "b", "C", "e")), + np) + + def test_nested_filter_normpath_posixpath_upper(self): + p1 = u(os.path.join("a", "b", "C", "d")) + cfg1 = { + u("path1"): p1, + u("path2"): u("{{|{{path1}}/../e|normpath,posixpath,upper|}}") + } + cfg = cfg = configmix.config.Configuration(cfg1) + np = cfg.getvarl_s(u("path2")) + self.assertEqual( + u(os.path.join("A", "B", "C", "E")), + np) + class T09Parser(_TParserMixin, unittest.TestCase):
