def test_get_next_task_returns_none_on_invalid_json( self, mock_brpoplpush, mock_lpop): self.assertIsNone(job_processor.get_next_task()) mock_brpoplpush.assert_called_once_with("mq:contract-task", "mq:contract-pending", 0, decode=False) mock_lpop.assert_called_once_with("mq:contract-pending")
def test_can_get_next_task(self, mock_brpop): self.assertEqual(job_processor.get_next_task(), valid_task_definition) mock_brpop.assert_called_once_with("mq:contract-task", 0, decode=False)