Mercurial > hgrepos > Python > libs > ConfigMix
changeset 720:6d9552eb7e4d
Further test of filter-only expansions: with "normpath"
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Wed, 16 Aug 2023 16:11:40 +0200 |
| parents | 3547dea62ef6 |
| children | a8bcb22341cd |
| files | tests/test.py |
| diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test.py Wed Aug 16 14:00:38 2023 +0200 +++ b/tests/test.py Wed Aug 16 16:11:40 2023 +0200 @@ -2450,6 +2450,17 @@ y = getattr(cfg, self.interpolate_meth)(u"{{|pre_{{key-1}}_post|upper|}}") self.assertEqual(u("PRE_VALUE FOR KEY-1_POST"), y) + def test_global_filter_normpath(self): + cfg1 = { + u("path1"): u("a\\b\\c"), + u("path2"): u("{{|{{path1}}/../d|normpath|}}") + } + cfg = cfg = configmix.config.Configuration(cfg1) + np = cfg.getvarl_s(u("path2")) + self.assertEqual( + os.path.normpath(u("a/b/d")), + np) + class T09Parser(_TParserMixin, unittest.TestCase):
