diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-20 22:55:40 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-20 22:55:40 -0500 |
| commit | 3fa782f5b5e3bd4445a5db63c0fce5aaac2d4ac3 (patch) | |
| tree | 2fb11ecde1046ac202808f0a8f0b0b41b51e1aae /tests/test_ini_parser.py | |
| parent | Remove `all`, start convert to google docstring, add other parsers (diff) | |
| download | config-file-3fa782f5b5e3bd4445a5db63c0fce5aaac2d4ac3.zip | |
Add work in progress tests
Diffstat (limited to 'tests/test_ini_parser.py')
| -rw-r--r-- | tests/test_ini_parser.py | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/tests/test_ini_parser.py b/tests/test_ini_parser.py index d39758e..6577291 100644 --- a/tests/test_ini_parser.py +++ b/tests/test_ini_parser.py @@ -1,7 +1,7 @@ import pytest from config_file.exceptions import ParsingError -from config_file.parsers import IniParser +from config_file.parsers.ini_parser import IniParser @pytest.mark.parametrize("ini_file", ["blahblahblah", "{ 'key1': 5 }"]) @@ -11,29 +11,19 @@ def test_incorrect_ini_formats(ini_file): @pytest.mark.parametrize( - "section_key,expected_value,parse_type", + "section_key,expected_value", [ - ("test_section.intkey", 5, True), - ("test_section.strkey", "blah", True), - ("test_section.boolkey", False, True), - ("test_section.floatkey", 5.3, True), - ("test_section.intkey", "5", False), - ("test_section.strkey", "blah", False), - ("test_section.boolkey", "false", False), - ("test_section.floatkey", "5.3", False), + ("test_section.intkey", "5"), + ("test_section.strkey", "blah"), + ("test_section.boolkey", "false"), + ("test_section.floatkey", "5.3"), ( "test_section", {"intkey": "5", "strkey": "blah", "boolkey": "false", "floatkey": "5.3"}, - False, - ), - ( - "test_section", - {"intkey": 5, "strkey": "blah", "boolkey": False, "floatkey": 5.3}, - True, ), ], ) -def test_that_ini_parser_can_get_values(section_key, expected_value, parse_type): +def test_that_ini_parser_can_get_values(section_key, expected_value): ini_file = """[test_section] intkey = 5 strkey = blah @@ -42,7 +32,7 @@ floatkey = 5.3 """ parser = IniParser(ini_file) - assert parser.get(section_key, parse_types=parse_type) == expected_value + assert parser.get(section_key) == expected_value @pytest.mark.parametrize( |