Skip to content

Commit

Permalink
Code review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Jun 4, 2024
1 parent 89c9818 commit 9e607ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/palace/manager/api/odl.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def get_license_status_document(self, loan: Loan) -> dict[str, Any]:
)
self.log.error(
f"Error getting License Status Document for loan ({loan.id}): Url '{url}' returned "
f"status code {response.status_code}. Response headers: {header_string}. "
f"status code {response.status_code}. Expected 2XX. Response headers: {header_string}. "
f"Response content: {response_string}."
)
raise BadResponseException(url, "License Status Document request failed.")
Expand Down
6 changes: 3 additions & 3 deletions tests/manager/api/test_odl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TestODLAPI:
def test_get_license_status_document_success(
self, odl_api_test_fixture: ODLAPITestFixture
) -> None:
# With a new loan.
# With a new loan. New loan returns a 201 status.
loan, _ = odl_api_test_fixture.license.loan_to(odl_api_test_fixture.patron)
odl_api_test_fixture.api.queue_response(
201, content=json.dumps(dict(status="ready"))
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_get_license_status_document_success(
== notification_url
)

# With an existing loan.
# With an existing loan. Existing loan returns a 200 status.
loan, _ = odl_api_test_fixture.license.loan_to(odl_api_test_fixture.patron)
loan.external_identifier = odl_api_test_fixture.db.fresh_str()

Expand Down Expand Up @@ -139,7 +139,7 @@ def test_get_license_status_document_errors(
odl_api_test_fixture.api.get_license_status_document,
loan,
)
assert "returned status code 403." in caplog.text
assert "returned status code 403. Expected 2XX." in caplog.text
assert "just junk ..." in caplog.text

def test_checkin_success(
Expand Down

0 comments on commit 9e607ed

Please sign in to comment.