From c57bc17e43561c745a9913cb21a90c84db684ef0 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 6 Aug 2020 12:29:28 -0500 Subject: Add test for Default util --- tests/test_utils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/test_utils.py') 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 ()" -- cgit v1.2.3