Exemplo n.º 1
0
    def test_from_dict_full_subtasks(self):
        c = chain(self.add.si(1, 2), self.add.si(3, 4), self.add.si(5, 6))

        serialized = json.loads(json.dumps(c))

        deserialized = chain.from_dict(serialized)

        for task in deserialized.tasks:
            assert isinstance(task, Signature)
Exemplo n.º 2
0
    def test_from_dict_full_subtasks(self):
        c = chain(self.add.si(1, 2), self.add.si(3, 4), self.add.si(5, 6))

        serialized = json.loads(json.dumps(c))

        deserialized = chain.from_dict(serialized)

        for task in deserialized.tasks:
            assert isinstance(task, Signature)
Exemplo n.º 3
0
 def test_from_dict_no_args__with_args(self):
     x = dict(self.add.s(2, 2) | self.add.s(4))
     x['args'] = None
     self.assertIsInstance(chain.from_dict(x), chain)
     x['args'] = (2, )
     self.assertIsInstance(chain.from_dict(x), chain)
Exemplo n.º 4
0
 def test_from_dict_no_tasks(self):
     self.assertTrue(
         chain.from_dict(dict(chain(app=self.app)), app=self.app))
Exemplo n.º 5
0
 def test_from_dict_no_args__with_args(self):
     x = dict(self.add.s(2, 2) | self.add.s(4))
     x['args'] = None
     assert isinstance(chain.from_dict(x), _chain)
     x['args'] = (2,)
     assert isinstance(chain.from_dict(x), _chain)
Exemplo n.º 6
0
 def test_from_dict_no_tasks(self):
     assert chain.from_dict(dict(chain(app=self.app)), app=self.app)
Exemplo n.º 7
0
 def test_from_dict_no_args__with_args(self):
     x = dict(add.s(2, 2) | add.s(4))
     x['args'] = None
     self.assertIsInstance(chain.from_dict(x), chain)
     x['args'] = (2, )
     self.assertIsInstance(chain.from_dict(x), chain)