diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-29 23:53:15 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-29 23:53:15 -0500 |
| commit | 3c1ebfaf0db4a29cc8ee9ba742c6d8925dc79cff (patch) | |
| tree | 8cc6627d9d4c74bd804f452378346bf904efa31c /tests | |
| parent | Revise `get` section for readme docs (diff) | |
| download | config-file-3c1ebfaf0db4a29cc8ee9ba742c6d8925dc79cff.zip | |
Allow string lists and dicts to be auto parsed
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_parse_value.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_parse_value.py b/tests/test_parse_value.py index 81db472..63ce6bb 100644 --- a/tests/test_parse_value.py +++ b/tests/test_parse_value.py @@ -19,13 +19,16 @@ from config_file.parsers.parse_value import can_be_parsed_as_bool, parse_value (True, True), ({"blah": "5"}, {"blah": 5}), ( - {"blah": {"blah2": {"blah3": "false"}, "abc": "5.25", "boo": "tRuE"}}, + {"blah": {"blah2": {"blah3": "fAlSe"}, "abc": "5.25", "boo": "tRuE"}}, {"blah": {"blah2": {"blah3": False}, "abc": 5.25, "boo": True}}, ), ( ["5", "4.4", "faLSe", "trUE", "foo", "-5", "-5.2"], [5, 4.4, False, True, "foo", -5, -5.2], ), + ("[1, 2, 3]", [1, 2, 3]), + ("[True, [1, 5], {}, 5.5]", [True, [1, 5], {}, 5.5]), + ("{ 'key': '5', 'key2': 'fAlSE' }", {"key": 5, "key2": False}), ], ) def test_parse_value(test_input, expected): |