diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-06-20 13:41:35 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-06-20 15:56:19 -0500 |
| commit | aa44fe7a60a4f3326cc47877b3e246b56d46d6ac (patch) | |
| tree | c30961887bf720ba8c676250174318029f0ad786 /tests/test_config_file.py | |
| parent | Create python-package-ci.yml (diff) | |
| download | config-file-aa44fe7a60a4f3326cc47877b3e246b56d46d6ac.zip | |
Add python 3.5 support, ConfigFileError, and more type hints
Also, get_all, set_all, and delete_all in JsonParser have been
renamed to just all.
Diffstat (limited to 'tests/test_config_file.py')
| -rw-r--r-- | tests/test_config_file.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_config_file.py b/tests/test_config_file.py index f083538..fe8539f 100644 --- a/tests/test_config_file.py +++ b/tests/test_config_file.py @@ -3,8 +3,7 @@ from pathlib import Path import pytest -from config_file.config_file import ConfigFile -from config_file.parsers.base_parser import BaseParser +from config_file import ConfigFile, BaseParser @pytest.mark.parametrize( @@ -49,14 +48,14 @@ def test_missing_config_files_during_restore( tmpdir, file_extension, specify_original_config_path ): with pytest.raises(OSError): - temp_path = tmpdir / f"config.{file_extension}" + temp_path = tmpdir / "config.{}".format(file_extension) temp_path.write("") config = ConfigFile(str(temp_path)) if specify_original_config_path: - specify_original_config_path = f"does_not_exist.{file_extension}" + specify_original_config_path = "does_not_exist.{}".format(file_extension) else: - config.path = f"does_not_exist.{file_extension}" + config.path = "does_not_exist.{}".format(file_extension) specify_original_config_path = None config.restore_original(original_file_path=specify_original_config_path) @@ -160,7 +159,7 @@ def test_that_config_file_can_get( def test_that_config_file_can_find_sections_and_keys( tmpdir, file_extension, file_contents, section_key, expected_result ): - config_path = tmpdir / f"config.{file_extension}" + config_path = tmpdir / "config.{}".format(file_extension) config_path.write_text(file_contents, encoding="utf-8") config = ConfigFile(str(config_path)) assert config.has(section_key) == expected_result |