diff --git a/test/test_queue.py b/test/test_queue.py index ca7012263..b066c2e2f 100644 --- a/test/test_queue.py +++ b/test/test_queue.py @@ -244,6 +244,24 @@ class TestQueue(QueueTestCase): count = self.queue.num_available_jobs_between(now, now, 'abc') self.assertEqual(0, count) + def test_complete(self): + # Add some items. + self.queue.put(['somenamespace', 'abc', 'def'], self.TEST_MESSAGE_1, available_after=-10) + + now = datetime.utcnow() + count = self.queue.num_available_jobs_between(now - timedelta(seconds=60), now, + ['/somenamespace']) + self.assertEqual(1, count) + + # Retrieve it. + item = self.queue.get() + self.assertIsNotNone(item) + self.assertTrue(self.reporter.currently_processing) + + # Mark it as complete. + self.queue.complete(item) + self.assertFalse(self.reporter.currently_processing) + def test_cancel(self): # Add an item. self.queue.put(['somenamespace', 'abc', 'def'], self.TEST_MESSAGE_1, available_after=-10)