Skip to content

Commit

Permalink
test: Fix test expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 26, 2024
1 parent f132d6d commit 9b6b192
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/extensions/test_kingfisher_process_api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def test_from_crawler_with_database_url():
])
@pytest.mark.parametrize('call_count,status_code,messages', [
(2, 200, [
('INFO', 'Created collection 1 in Kingfisher Process'), ('INFO', 'Closed collection 1 in Kingfisher Process')
('INFO', 'Created collection 1 in Kingfisher Process (DATA_VERSION)'),
('INFO', 'Closed collection 1 in Kingfisher Process'),
]),
(1, 500, [
('ERROR', 'Failed to create collection: HTTP 500 ({"collection_id": 1}) ({})'),
Expand Down Expand Up @@ -204,6 +205,8 @@ def test_spider_opened(
calls[1].args[2].pop('stats') # pop() ensures its presence
assert calls[1].args[1:] == ('/api/collections/1/close/', {'reason': 'finished'})

messages = [(levelname, message.replace('DATA_VERSION', data_version)) for levelname, message in messages]

for levelname, message in messages:
assert any(r.name == 'test' and r.levelname == levelname and r.message == message for r in caplog.records)

Expand Down

0 comments on commit 9b6b192

Please sign in to comment.