Mercurial > hgrepos > Python > libs > ConfigMix
changeset 486:5a88c514d4e0
More unittests for interpolation
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 17 Dec 2021 15:56:53 +0100 |
| parents | 008b35666a43 |
| children | d7f6f2afcee2 |
| files | tests/data/conf22.ini tests/test.py |
| diffstat | 2 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/data/conf22.ini Fri Dec 17 15:56:33 2021 +0100 +++ b/tests/data/conf22.ini Fri Dec 17 15:56:53 2021 +0100 @@ -8,3 +8,4 @@ [config.db.locinfo.ro] hostname = 3rd-host +hostname2 = {{db.locinfo.ro.hostname}}{{db.locinfo.ro.hostname}}
--- a/tests/test.py Fri Dec 17 15:56:33 2021 +0100 +++ b/tests/test.py Fri Dec 17 15:56:53 2021 +0100 @@ -225,6 +225,14 @@ u("postgresql+psycopg2://the_database_user_2:the-database-password-2@3rd-host:5432/my_database_catalog"), url) + def test02b_load_with_ini(self): + cfg = self._load( + os.path.join(TESTDATADIR, "conf20.yml"), + os.path.join(TESTDATADIR, "conf21.yml"), + os.path.join(TESTDATADIR, "conf22.ini")) + self.assertEqual(u("3rd-host3rd-host"), + cfg.getvar_s("db.locinfo.ro.hostname2")) + def test02_load_with_json(self): cfg = self._load( os.path.join(TESTDATADIR, "conf20.yml"),
