# HG changeset patch # User Franz Glasner # Date 1521903892 -3600 # Node ID 057d87d030f12fc35f1c3f53e5c3e487ceb9ce50 # Parent 2196362c046773bc8428af34be7fba48a37a8066 Test replacing lists by strings and replacing strings by lists diff -r 2196362c0467 -r 057d87d030f1 tests/data/conf20.yml --- a/tests/data/conf20.yml Sat Mar 24 15:35:10 2018 +0100 +++ b/tests/data/conf20.yml Sat Mar 24 16:04:52 2018 +0100 @@ -88,3 +88,12 @@ profile_dir: '{{tmpdir}}/profiler' #sort_by: ['time', 'calls'] #restrictions=(), + +test: + List: + - 0 + - 1 + - 2 + - 3 + + Str: a string diff -r 2196362c0467 -r 057d87d030f1 tests/data/conf21.yml --- a/tests/data/conf21.yml Sat Mar 24 15:35:10 2018 +0100 +++ b/tests/data/conf21.yml Sat Mar 24 16:04:52 2018 +0100 @@ -18,3 +18,11 @@ locinfo: ro: hostname: anotherhost + +test: + List: not a list any more + + Str: + - 0 + - 1 + - 2 diff -r 2196362c0467 -r 057d87d030f1 tests/test.py --- a/tests/test.py Sat Mar 24 15:35:10 2018 +0100 +++ b/tests/test.py Sat Mar 24 16:04:52 2018 +0100 @@ -121,6 +121,12 @@ u("postgresql+psycopg2://the_database_user:the-database-password@anotherhost:5432/my_database_catalog"), url) + self.assertEqual(u("not a list any more"), + cfg.getvar_s("test.List")) + + self.assertEqual(list(range(0, 3)), + cfg.getvar_s("test.Str")) + def test02_load_with_ini(self): cfg = configmix.load( os.path.join(TESTDATADIR, "conf20.yml"),