diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-08-06 12:29:28 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-08-06 12:29:28 -0500 |
| commit | c57bc17e43561c745a9913cb21a90c84db684ef0 (patch) | |
| tree | 1406221f67f2da79c6d53bed25b75a3cd68ba801 | |
| parent | Change MissingKeyErrors to KeyError (diff) | |
| download | config-file-c57bc17e43561c745a9913cb21a90c84db684ef0.zip | |
Add test for Default util
| -rw-r--r-- | tests/test_utils.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 6779d18..1f22e0b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,6 @@ import pytest -from config_file.utils import split_on_dot +from config_file.utils import Default, split_on_dot @pytest.mark.parametrize( @@ -17,3 +17,13 @@ def test_that_split_on_dot_splits_the_line_correctly( def test_that_split_on_dot_raises_error_when_there_is_no_dot(test_input): with pytest.raises(ValueError): split_on_dot(test_input) + + +def test_that_default_is_initialized_correctly(): + default = Default(5) + assert default.value == 5 + + +def test_that_default_has_the_correct_repr_format(): + default = Default("test") + assert str(default) == "Default Value: test (<class 'str'>)" |