MCPcopy Create free account
hub / github.com/airbnb/binaryalert / test_enqueue

Method test_enqueue

tests/cli/manager_test.py:38–45  ·  view source on GitHub ↗

SQS messages are batched and enqueued

(self, mock_print: mock.MagicMock, mock_worker: mock.MagicMock,
                     mock_task_queue: mock.MagicMock)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

_enqueueMethod · 0.80

Tested by

no test coverage detected