SQS messages are batched and enqueued
(self, mock_print: mock.MagicMock, mock_worker: mock.MagicMock,
mock_task_queue: mock.MagicMock)
| 36 | @mock.patch.object(manager_module, 'Worker') |
| 37 | @mock.patch.object(manager_module, 'print') |
| 38 | def test_enqueue(self, mock_print: mock.MagicMock, mock_worker: mock.MagicMock, |
| 39 | mock_task_queue: mock.MagicMock): |
| 40 | """SQS messages are batched and enqueued""" |
| 41 | messages = ({'index': i} for i in range(25)) |
| 42 | self.manager._enqueue('test-queue', messages, lambda msg: (1, msg['index'])) |
| 43 | mock_task_queue.assert_called() |
| 44 | mock_worker.assert_called() |
| 45 | mock_print.assert_called() |
| 46 | |
| 47 | @mock.patch.object(subprocess, 'check_call') |
| 48 | def test_apply(self, mock_subprocess: mock.MagicMock): |