Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/test.py @ 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 |
comparison
equal
deleted
inserted
replaced
| 737:282c8e64d7b1 | 738:20e3c2d956d9 |
|---|---|
| 2472 np = cfg.getvarl_s(u("path2")) | 2472 np = cfg.getvarl_s(u("path2")) |
| 2473 self.assertEqual( | 2473 self.assertEqual( |
| 2474 u(os.path.join("a", "b", "d")), | 2474 u(os.path.join("a", "b", "d")), |
| 2475 np) | 2475 np) |
| 2476 | 2476 |
| 2477 def test_nested_filter_normpath_posixpath_2(self): | |
| 2478 p1 = u(os.path.join("a", "b", "C", "d")) | |
| 2479 cfg1 = { | |
| 2480 u("path1"): p1, | |
| 2481 u("path2"): u("{{|{{path1}}/../e|normpath,posixpath|}}") | |
| 2482 } | |
| 2483 cfg = cfg = configmix.config.Configuration(cfg1) | |
| 2484 np = cfg.getvarl_s(u("path2")) | |
| 2485 self.assertEqual( | |
| 2486 u(os.path.join("a", "b", "C", "e")), | |
| 2487 np) | |
| 2488 | |
| 2489 def test_nested_filter_normpath_posixpath_upper(self): | |
| 2490 p1 = u(os.path.join("a", "b", "C", "d")) | |
| 2491 cfg1 = { | |
| 2492 u("path1"): p1, | |
| 2493 u("path2"): u("{{|{{path1}}/../e|normpath,posixpath,upper|}}") | |
| 2494 } | |
| 2495 cfg = cfg = configmix.config.Configuration(cfg1) | |
| 2496 np = cfg.getvarl_s(u("path2")) | |
| 2497 self.assertEqual( | |
| 2498 u(os.path.join("A", "B", "C", "E")), | |
| 2499 np) | |
| 2500 | |
| 2477 | 2501 |
| 2478 class T09Parser(_TParserMixin, unittest.TestCase): | 2502 class T09Parser(_TParserMixin, unittest.TestCase): |
| 2479 | 2503 |
| 2480 def setUp(self): | 2504 def setUp(self): |
| 2481 self.unquote = configmix.config.py_unquote | 2505 self.unquote = configmix.config.py_unquote |
