Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/test.py @ 711:6557cf9ecea5
FIX: When using attribute access for configurations the values are interpolated since long ago: fix the docu and add a test for that behaviour
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Tue, 15 Aug 2023 15:09:11 +0200 |
| parents | ff0de14493f1 |
| children | 6d9552eb7e4d |
comparison
equal
deleted
inserted
replaced
| 710:ff0de14493f1 | 711:6557cf9ecea5 |
|---|---|
| 1867 jcfg = cfg.jailed(rootpath=(u"tree1",)) | 1867 jcfg = cfg.jailed(rootpath=(u"tree1",)) |
| 1868 | 1868 |
| 1869 self.assertEqual(0x20, jcfg.key3) | 1869 self.assertEqual(0x20, jcfg.key3) |
| 1870 self.assertEqual(u"off", jcfg.tree2.key6) | 1870 self.assertEqual(u"off", jcfg.tree2.key6) |
| 1871 | 1871 |
| 1872 def test_attribute_access_interpolates(self): | |
| 1873 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py")) | |
| 1874 self.assertEqual( | |
| 1875 [u"val1", u"val2", u"in the root namespace"], | |
| 1876 cfg.tree1.tree2.key8) | |
| 1877 | |
| 1872 def test_attribute_access_non_existing(self): | 1878 def test_attribute_access_non_existing(self): |
| 1873 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py")) | 1879 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py")) |
| 1874 jcfg = cfg.jailed(rootpath=(u"tree1",)) | 1880 jcfg = cfg.jailed(rootpath=(u"tree1",)) |
| 1875 | 1881 |
| 1876 try: | 1882 try: |
