From 836e186ab1dbe2af58c3c3e31d3dd90c074624b1 Mon Sep 17 00:00:00 2001 From: jbannon Date: Tue, 5 Apr 2022 00:28:52 +0000 Subject: [PATCH] fix unit tests --- tests/unit/entries/test_entry.py | 2 +- tests/unit/entries/test_entry_formatter.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/entries/test_entry.py b/tests/unit/entries/test_entry.py index 0ccd323a..6cd1bbe1 100644 --- a/tests/unit/entries/test_entry.py +++ b/tests/unit/entries/test_entry.py @@ -65,7 +65,7 @@ class TestEntry(object): def test_entry_formatter_fails_missing_field(self, mock_entry): format_string = f"prefix {{bah_humbug}} suffix" - available_fields = ", ".join(sorted(mock_entry.to_dict()._keys())) + available_fields = ", ".join(sorted(mock_entry.to_dict().keys())) expected_error_msg = f"Format variable 'bah_humbug' does not exist for Entry. Available fields: {available_fields}" with pytest.raises(ValueError, match=expected_error_msg): diff --git a/tests/unit/entries/test_entry_formatter.py b/tests/unit/entries/test_entry_formatter.py index 5ab5a15f..10712c99 100644 --- a/tests/unit/entries/test_entry_formatter.py +++ b/tests/unit/entries/test_entry_formatter.py @@ -20,14 +20,14 @@ class TestEntryFormatter(object): def test_parse(self): format_string = "Here is my {var_one} and {var_two} 💩" assert StringFormatterValidator( - name="test_format_variables", format_string=format_string + name="test_format_variables", value=format_string ).format_variables == ["var_one", "var_two"] def test_parse_no_variables(self): format_string = "No vars 💩" assert ( StringFormatterValidator( - name="test_format_variables_empty", format_string=format_string + name="test_format_variables_empty", value=format_string ).format_variables == [] ) @@ -49,7 +49,7 @@ class TestEntryFormatter(object): ) with pytest.raises(ValidationException, match=expected_error_msg): - _ = StringFormatterValidator(name="fail", format_string=format_string) + _ = StringFormatterValidator(name="fail", value=format_string) @pytest.mark.parametrize( "format_string", @@ -70,4 +70,4 @@ class TestEntryFormatter(object): ) with pytest.raises(ValidationException, match=expected_error_msg): - _ = StringFormatterValidator(name="fail", format_string=format_string) + _ = StringFormatterValidator(name="fail", value=format_string)