Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test_queue: Use assertLogs to verify warning in test_queue_error_json.
Mohit Gupta732f1fa44d66
diff --git a/zerver/tests/test_queue.py b/zerver/tests/test_queue.pyindex d08b43e172c..c25482be6d8 100644--- a/zerver/tests/test_queue.py+++ b/zerver/tests/test_queue.py@@ -98,8 +98,11 @@ class TestQueueImplementation(ZulipTestCase):actual_publish(*args, **kwargs)with mock.patch("zerver.lib.queue.SimpleQueueClient.publish",- throw_connection_error_once):+ throw_connection_error_once), self.assertLogs('zulip.queue', level='WARN') as warn_logs:queue_json_publish("test_suite", {"event": "my_event"})+ self.assertEqual(warn_logs.output, [+ 'WARNING:zulip.queue:Failed to send to rabbitmq, trying to reconnect and send again'+ ])result = queue_client.json_drain_queue("test_suite")self.assertEqual(len(result), 1)