Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/test.py @ 737:282c8e64d7b1
FIX: tests on non-Windows
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 29 Oct 2023 11:32:56 +0100 |
| parents | ef7bee8b54e1 |
| children | 20e3c2d956d9 |
comparison
equal
deleted
inserted
replaced
| 736:324ae9a56a75 | 737:282c8e64d7b1 |
|---|---|
| 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_nested_filter_normpath(self): | 2453 def test_nested_filter_normpath(self): |
| 2454 p1 = u(os.path.join("a", "b", "c")) | |
| 2454 cfg1 = { | 2455 cfg1 = { |
| 2455 u("path1"): u("a\\b\\c"), | 2456 u("path1"): p1, |
| 2456 u("path2"): u("{{|{{path1}}/../d|normpath|}}") | 2457 u("path2"): u("{{|{{path1}}/../d|normpath|}}") |
| 2457 } | 2458 } |
| 2458 cfg = cfg = configmix.config.Configuration(cfg1) | 2459 cfg = cfg = configmix.config.Configuration(cfg1) |
| 2459 np = cfg.getvarl_s(u("path2")) | 2460 np = cfg.getvarl_s(u("path2")) |
| 2460 self.assertEqual( | 2461 self.assertEqual( |
| 2461 os.path.normpath(u("a/b/d")), | 2462 os.path.normpath(u(os.path.join("a", "b", "d"))), |
| 2462 np) | 2463 np) |
| 2463 | 2464 |
| 2464 def test_nested_filter_normpath_posixpath(self): | 2465 def test_nested_filter_normpath_posixpath(self): |
| 2466 p1 = u(os.path.join("a", "b", "c")) | |
| 2465 cfg1 = { | 2467 cfg1 = { |
| 2466 u("path1"): u("a\\b\\c"), | 2468 u("path1"): p1, |
| 2467 u("path2"): u("{{|{{path1}}/../d|normpath,posixpath|}}") | 2469 u("path2"): u("{{|{{path1}}/../d|normpath,posixpath|}}") |
| 2468 } | 2470 } |
| 2469 cfg = cfg = configmix.config.Configuration(cfg1) | 2471 cfg = cfg = configmix.config.Configuration(cfg1) |
| 2470 np = cfg.getvarl_s(u("path2")) | 2472 np = cfg.getvarl_s(u("path2")) |
| 2471 self.assertEqual( | 2473 self.assertEqual( |
| 2472 u("a/b/d"), | 2474 u(os.path.join("a", "b", "d")), |
| 2473 np) | 2475 np) |
| 2474 | 2476 |
| 2475 | 2477 |
| 2476 class T09Parser(_TParserMixin, unittest.TestCase): | 2478 class T09Parser(_TParserMixin, unittest.TestCase): |
| 2477 | 2479 |
