Skip to content

Commit

Permalink
Fix the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhwaniartefact committed Oct 22, 2024
1 parent 3bb0b2f commit 6f1b182
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test_fixity.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,14 @@ def test_main_verifies_urls_with_trailing_slash(
mock_check_fixity: List[mock.Mock],
monkeypatch: pytest.MonkeyPatch,
) -> None:
_get.side_effect = mock_check_fixity
_get.side_effect = [
mock.Mock(**{"status_code": 200}, spec=requests.Response),
mock.Mock(**{"status_code": 401}, spec=requests.Response),
]
aip_id = uuid.uuid4()
stream = io.StringIO()
monkeypatch.setenv("STORAGE_SERVICE_URL", "http://foo")
ss_url = "http://foo"
monkeypatch.setenv("STORAGE_SERVICE_URL", ss_url)
monkeypatch.setenv("STORAGE_SERVICE_USER", STORAGE_SERVICE_USER)
monkeypatch.setenv("STORAGE_SERVICE_KEY", STORAGE_SERVICE_KEY)
report_url = "http://bar"
Expand All @@ -691,14 +695,13 @@ def test_main_verifies_urls_with_trailing_slash(

response = fixity.main(["scan", str(aip_id)], stream=stream)

assert response == 0
assert response is None

_assert_stream_content_matches(
stream,
[
f"Unable to POST pre-scan report to {report_url}/",
f"Fixity scan succeeded for AIP: {aip_id}",
f"Unable to POST report for AIP {aip_id} to remote service",
f'Storage service at "{ss_url}/" failed authentication while scanning AIP {aip_id}',
],
)

Expand Down

0 comments on commit 6f1b182

Please sign in to comment.