Ejemplo n.º 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'),
         )
Ejemplo n.º 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()))
Ejemplo n.º 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")
Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 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()))