Mercurial > hgrepos > Python > libs > ConfigMix
changeset 313:15a1d5fd0aa1
Further unittest for config reference expansion
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 29 Apr 2021 08:43:15 +0200 |
| parents | 0788e8e162f6 |
| children | 043a6412be3c |
| files | tests/data/reference-style.yml tests/test.py |
| diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/data/reference-style.yml Wed Apr 28 09:28:48 2021 +0200 +++ b/tests/data/reference-style.yml Thu Apr 29 08:43:15 2021 +0200 @@ -12,3 +12,6 @@ testref: here: '{{ref:#wsgi.profiler}}' + +expand-ref-value: + key0: '{{testref.here.params.params.evalex}}'
--- a/tests/test.py Wed Apr 28 09:28:48 2021 +0200 +++ b/tests/test.py Thu Apr 29 08:43:15 2021 +0200 @@ -575,6 +575,14 @@ self.assertTrue(isinstance(self._cfg.expand_if_reference(v["params"]), dict)) + def test08_explicit_indirect_expansion_through_value(self): + v = self._cfg.getvar_s("expand-ref-value.key0") + self.assertTrue(isinstance(v, bool)) + self.assertTrue(v) + # but not that .getvar does not **not** + v2 = self._cfg.getvar("expand-ref-value.key0") + self.assertEqual("{{testref.here.params.params.evalex}}", v2) + if __name__ == "__main__": unittest.main()
