Skip to content

Commit b5319de

Browse files
EKIR-418 Update tests
1 parent 713de11 commit b5319de

File tree

4 files changed

+140
-162
lines changed

4 files changed

+140
-162
lines changed

tests/api/metadata/test_novelist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,5 +725,5 @@ def test_put(self, novelist_fixture: NoveListFixture, monkeypatch: MonkeyPatch):
725725

726726
novelist_fixture.novelist.put("http://apiendpoint.com", headers, data=data)
727727
mock_put.assert_called_once_with(
728-
"http://apiendpoint.com", data, headers=headers, timeout=None
728+
"http://apiendpoint.com", headers=headers, timeout=None
729729
)

tests/api/test_overdrive.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,42 +2109,6 @@ def test_refresh_patron_access_token(
21092109
assert "false" == payload["password_required"]
21102110
assert "[ignore]" == payload["password"]
21112111

2112-
def test_refresh_patron_access_token_is_fulfillment(
2113-
self, overdrive_api_fixture: OverdriveAPIFixture
2114-
):
2115-
"""Verify that patron information is included in the request
2116-
when refreshing a patron access token.
2117-
"""
2118-
db = overdrive_api_fixture.db
2119-
patron = db.patron()
2120-
patron.authorization_identifier = "barcode"
2121-
credential = db.credential(patron=patron)
2122-
2123-
# Mocked testing credentials
2124-
encoded_auth = base64.b64encode(b"TestingKey:TestingSecret")
2125-
2126-
# use a real Overdrive API
2127-
od_api = OverdriveAPI(db.session, overdrive_api_fixture.collection)
2128-
od_api._server_nickname = OverdriveConstants.TESTING_SERVERS
2129-
# but mock the request methods
2130-
od_api._do_post = MagicMock()
2131-
od_api._do_get = MagicMock()
2132-
response_credential = od_api.refresh_patron_access_token(
2133-
credential, patron, "a pin", is_fulfillment=True
2134-
)
2135-
2136-
# Posted once, no gets
2137-
od_api._do_post.assert_called_once()
2138-
od_api._do_get.assert_not_called()
2139-
2140-
# What did we Post?
2141-
call_args = od_api._do_post.call_args[0]
2142-
assert "/patrontoken" in call_args[0] # url
2143-
assert (
2144-
call_args[2]["Authorization"] == f"Basic {encoded_auth.decode()}"
2145-
) # Basic header should be that of the fulfillment keys
2146-
assert response_credential == credential
2147-
21482112
def test_cannot_fulfill_error_audiobook(
21492113
self, overdrive_api_fixture: OverdriveAPIFixture
21502114
):

tests/core/test_app_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def process_urns(self, urns, **kwargs):
302302
controller = Mock(session)
303303
with data.app.test_request_context("/?urn=foobar"):
304304
response = controller.work_lookup(annotator=object())
305-
assert INVALID_INPUT == response
305+
assert response is INVALID_INPUT
306306

307307
def test_permalink(self, urn_lookup_controller_fixture: URNLookupControllerFixture):
308308
data, session = (

0 commit comments

Comments
 (0)