Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/test.py @ 195:28e6c1413947
Added support for TOML style configuration files
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 03 May 2019 21:51:09 +0200 |
| parents | d1103f0f9166 |
| children | 13527d70e9e3 |
comparison
equal
deleted
inserted
replaced
| 194:0d8dd58afc44 | 195:28e6c1413947 |
|---|---|
| 14 import configmix | 14 import configmix |
| 15 import configmix.ini | 15 import configmix.ini |
| 16 import configmix.yaml | 16 import configmix.yaml |
| 17 import configmix.json | 17 import configmix.json |
| 18 import configmix.py | 18 import configmix.py |
| 19 import configmix.toml | |
| 19 from configmix.compat import u | 20 from configmix.compat import u |
| 20 | 21 |
| 21 | 22 |
| 22 TESTDATADIR = os.path.join( | 23 TESTDATADIR = os.path.join( |
| 23 os.path.abspath(os.path.dirname(__file__)), | 24 os.path.abspath(os.path.dirname(__file__)), |
| 125 | 126 |
| 126 def test10_json_tree(self): | 127 def test10_json_tree(self): |
| 127 cfg = configmix.json.load(os.path.join(TESTDATADIR, "conf10.json")) | 128 cfg = configmix.json.load(os.path.join(TESTDATADIR, "conf10.json")) |
| 128 self.__check_tree(cfg) | 129 self.__check_tree(cfg) |
| 129 | 130 |
| 131 def test11_toml_tree(self): | |
| 132 cfg = configmix.toml.load(os.path.join(TESTDATADIR, "conf10.toml")) | |
| 133 self.__check_tree(cfg) | |
| 134 | |
| 130 | 135 |
| 131 class _T02MixinLoadAndMerge: | 136 class _T02MixinLoadAndMerge: |
| 132 | 137 |
| 133 def test01_load(self): | 138 def test01_load(self): |
| 134 cfg = self._load( | 139 cfg = self._load( |
