Skip to content

Commit

Permalink
testfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Oct 13, 2023
1 parent 7023973 commit fe75aa3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ds-caselaw-ingester/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def test_update_document_xml_success(self, api_client):
xml = ET.XML("<xml>Here's some xml</xml>")
api_client.get_judgment_xml = MagicMock(return_value=True)
api_client.update_document_xml = MagicMock(return_value=True)
result = lambda_function.update_document_xml("a/fake/uri", xml)
result = lambda_function.update_document_xml("a/fake/uri", xml, {"test": True})
assert result is True

@patch("lambda_function.api_client", autospec=True)
Expand All @@ -660,7 +660,7 @@ def test_update_document_xml_judgment_does_not_exist(self, api_client):
side_effect=MarklogicResourceNotFoundError("error")
)
api_client.update_document_xml = MagicMock(return_value=True)
result = lambda_function.update_document_xml("a/fake/uri", xml)
result = lambda_function.update_document_xml("a/fake/uri", xml, {"test": True})
assert result is False

@patch("lambda_function.api_client", autospec=True)
Expand All @@ -671,13 +671,13 @@ def test_update_document_xml_judgment_does_not_save(self, api_client):
side_effect=MarklogicCommunicationError("error")
)
with pytest.raises(MarklogicCommunicationError):
lambda_function.update_document_xml("a/fake/uri", xml)
lambda_function.update_document_xml("a/fake/uri", xml, {"test": True})

@patch("lambda_function.api_client", autospec=True)
def test_insert_document_xml_success(self, api_client):
xml = ET.XML("<xml>Here's some xml</xml>")
api_client.insert_document_xml = MagicMock(return_value=True)
result = lambda_function.insert_document_xml("a/fake/uri", xml)
result = lambda_function.insert_document_xml("a/fake/uri", xml, {"test": True})
assert result is True

@patch("lambda_function.api_client", autospec=True)
Expand All @@ -687,7 +687,7 @@ def test_insert_document_xml_failure(self, api_client):
side_effect=MarklogicCommunicationError("error")
)
with pytest.raises(MarklogicCommunicationError):
lambda_function.insert_document_xml("a/fake/uri", xml)
lambda_function.insert_document_xml("a/fake/uri", xml, {"test": True})

def test_get_best_xml_with_valid_xml_file(self):
filename = "TDR-2022-DNWR.xml"
Expand Down

0 comments on commit fe75aa3

Please sign in to comment.