From 90c8ebd220b0e15b75e9c1efc6c760f8b6592c4f Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 7 Aug 2017 21:09:44 -0300 Subject: [bug] skip processing if no consumers to avoid data loss --- testing/tests/client/test_incoming_processing_flow.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testing') diff --git a/testing/tests/client/test_incoming_processing_flow.py b/testing/tests/client/test_incoming_processing_flow.py index 1e64fcc2..40409f0a 100644 --- a/testing/tests/client/test_incoming_processing_flow.py +++ b/testing/tests/client/test_incoming_processing_flow.py @@ -76,6 +76,14 @@ class IncomingBoxProcessingTestCase(unittest.TestCase): yield self.loop() self.box.fetch_for_processing.assert_called_once_with('one_item') + @defer.inlineCallbacks + def test_no_consumers(self): + items = ['one', 'two', 'three'] + self._set_pending_items(items) + yield self.loop() + self.box.fetch_for_processing.assert_not_called() + self.box.delete.assert_not_called() + @defer.inlineCallbacks def test_pending_list_with_multiple_items(self): items = ['one', 'two', 'three'] -- cgit v1.2.3