Skip to content

Commit

Permalink
resolve broken tests with side effect
Browse files Browse the repository at this point in the history
  • Loading branch information
DGaffney committed Nov 14, 2024
1 parent 32ef971 commit ab01501
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lib/queue/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ def setUp(self, mock_log_execution_time, mock_get_env_setting, mock_boto_resourc
self.mock_dlq_queue = MagicMock()
self.mock_dlq_queue.url = f"http://queue/{self.queue_name_dlq}"
self.mock_dlq_queue.attributes = {"QueueArn": f"queue:{self.queue_name_dlq}"}
self.mock_sqs_resource.get_queue_by_name.return_value = self.mock_input_queue#[, self.mock_output_queue, self.mock_dlq_queue]
self.mock_sqs_resource.get_queue_by_name.side_effect = lambda QueueName: {
self.queue_name_input: self.mock_input_queue,
self.queue_name_output: self.mock_output_queue,
self.queue_name_dlq: self.mock_dlq_queue
}.get(QueueName)
mock_boto_resource.return_value = self.mock_sqs_resource

# Initialize the QueueWorker instance
Expand Down

0 comments on commit ab01501

Please sign in to comment.