Skip to content

Commit f96c196

Browse files
committed
Fix broken test
1 parent b4427fc commit f96c196

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/murfey/cli/repost_failed_calls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def run():
183183
security_config = security_from_file(args.config)
184184
PikaTransport().load_configuration_file(security_config.rabbitmq_credentials)
185185
_set_up_transport("PikaTransport")
186+
murfey.server._transport_object.feedback_queue = security_config.feedback_queue
186187

187188
# Purge the queue and repost/reinject any messages found
188189
dlq_dump_path = Path(args.dir)

tests/cli/test_repost_failed_calls.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def test_handle_failed_posts(tmp_path):
187187
assert (tmp_path / "msg6").is_file() # function does not exist
188188

189189

190+
@mock.patch("workflows.transport.pika_transport.PikaTransport")
191+
@mock.patch("murfey.cli.repost_failed_calls.PikaTransport")
190192
@mock.patch("murfey.cli.repost_failed_calls.dlq_purge")
191193
@mock.patch("murfey.cli.repost_failed_calls.handle_failed_posts")
192194
@mock.patch("murfey.cli.repost_failed_calls.handle_dlq_messages")
@@ -200,6 +202,8 @@ def test_run_repost_failed_calls(
200202
mock_reinject,
201203
mock_repost,
202204
mock_purge,
205+
mock_pika,
206+
mock_workflows,
203207
mock_security_configuration,
204208
):
205209
mock_session = mock.MagicMock()
@@ -227,6 +231,11 @@ def test_run_repost_failed_calls(
227231
mock_db_engine.assert_called_with("db_url")
228232
mock_db_session.assert_called_with("db_engine")
229233

234+
mock_pika().load_configuration_file.assert_called_with(
235+
Path("/path/to/rabbitmq.yaml")
236+
)
237+
mock_workflows().connect.assert_called_once()
238+
230239
mock_purge.assert_called_once_with(
231240
Path("DLQ_dir"),
232241
"murfey_feedback",

0 commit comments

Comments
 (0)