comparison tests/test.py @ 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 6557cf9ecea5
children c17a4e30ebbf
comparison
equal deleted inserted replaced
719:3547dea62ef6 720:6d9552eb7e4d
2448 } 2448 }
2449 cfg = cfg = configmix.config.Configuration(cfg1) 2449 cfg = cfg = configmix.config.Configuration(cfg1)
2450 y = getattr(cfg, self.interpolate_meth)(u"{{|pre_{{key-1}}_post|upper|}}") 2450 y = getattr(cfg, self.interpolate_meth)(u"{{|pre_{{key-1}}_post|upper|}}")
2451 self.assertEqual(u("PRE_VALUE FOR KEY-1_POST"), y) 2451 self.assertEqual(u("PRE_VALUE FOR KEY-1_POST"), y)
2452 2452
2453 def test_global_filter_normpath(self):
2454 cfg1 = {
2455 u("path1"): u("a\\b\\c"),
2456 u("path2"): u("{{|{{path1}}/../d|normpath|}}")
2457 }
2458 cfg = cfg = configmix.config.Configuration(cfg1)
2459 np = cfg.getvarl_s(u("path2"))
2460 self.assertEqual(
2461 os.path.normpath(u("a/b/d")),
2462 np)
2463
2453 2464
2454 class T09Parser(_TParserMixin, unittest.TestCase): 2465 class T09Parser(_TParserMixin, unittest.TestCase):
2455 2466
2456 def setUp(self): 2467 def setUp(self):
2457 self.unquote = configmix.config.py_unquote 2468 self.unquote = configmix.config.py_unquote