Skip to content

Commit

Permalink
Improve fetcher logs test
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed May 31, 2024
1 parent 809af1e commit 05f1b38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions trollmoves/tests/test_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,13 @@ def test_fetch_message_logs(tmp_path, caplog):
subscriber_settings = dict(nameserver=False, addresses=["ipc://bla"])
publisher_settings = dict(nameservers=False, port=1979)

with patched_subscriber_recv([Message(rawstr=msg)]):
fetch_from_subscriber(dest_path2, subscriber_settings, publisher_settings)
with patched_publisher() as messages:
with patched_subscriber_recv([Message(rawstr=msg)]):
fetch_from_subscriber(dest_path2, subscriber_settings, publisher_settings)

assert str(msg) in caplog.text
assert str(dest_path2 / uid) in caplog.text
assert "Published pytroll://" in caplog.text
assert f"Published {messages[0]}" in caplog.text


def test_subscribe_and_fetch(tmp_path):
Expand Down

0 comments on commit 05f1b38

Please sign in to comment.