Exemple #1
0
def test_move_task_by_id():
    with patch('celery.contrib.migrate.move') as move:
        move_task_by_id('123f', Queue('foo'))
        move.assert_called()
        cb = move.call_args[0][0]
        body = {'id': '123f'}
        assert cb(body, Message(body)) == Queue('foo')
 def test_move_task_by_id(self):
     with patch('celery.contrib.migrate.move') as move:
         move_task_by_id('123f', Queue('foo'))
         move.assert_called()
         cb = move.call_args[0][0]
         self.assertEqual(
             cb({'id': '123f'}, Mock()),
             Queue('foo'),
         )
Exemple #3
0
 def test_move_task_by_id(self):
     with patch('celery.contrib.migrate.move') as move:
         move_task_by_id('123f', Queue('foo'))
         move.assert_called()
         cb = move.call_args[0][0]
         self.assertEqual(
             cb({'id': '123f'}, Mock()),
             Queue('foo'),
         )
 def test_move_by_idmap(self):
     with patch('celery.contrib.migrate.move') as move:
         move_by_idmap({'123f': Queue('foo')})
         move.assert_called()
         cb = move.call_args[0][0]
         self.assertTrue(cb({'id': '123f'}, Mock()))
Exemple #5
0
def test_move_task_by_id():
    with patch("celery.contrib.migrate.move") as move:
        move_task_by_id("123f", Queue("foo"))
        move.assert_called()
        cb = move.call_args[0][0]
        assert cb({"id": "123f"}, Mock()) == Queue("foo")
Exemple #6
0
def test_move_by_taskmap():
    with patch("celery.contrib.migrate.move") as move:
        move_by_taskmap({"add": Queue("foo")})
        move.assert_called()
        cb = move.call_args[0][0]
        assert cb({"task": "add"}, Mock())
Exemple #7
0
def test_move_by_taskmap():
    with patch('celery.contrib.migrate.move') as move:
        move_by_taskmap({'add': Queue('foo')})
        move.assert_called()
        cb = move.call_args[0][0]
        assert cb({'task': 'add'}, Mock())
Exemple #8
0
def test_move_by_idmap():
    with patch('celery.contrib.migrate.move') as move:
        move_by_idmap({'123f': Queue('foo')})
        move.assert_called()
        cb = move.call_args[0][0]
        assert cb({'id': '123f'}, Mock())
Exemple #9
0
 def test_move_by_taskmap(self):
     with patch('celery.contrib.migrate.move') as move:
         move_by_taskmap({'add': Queue('foo')})
         move.assert_called()
         cb = move.call_args[0][0]
         self.assertTrue(cb({'task': 'add'}, Mock()))