Ejemplo n.º 1
0
    def test_from_dict(self):
        data_dict = {
            'id': 'task-7',
            'signature': {
                'options': {
                    'task_id': 'task-7'
                },
                'task': None,
                'args': (),
                'kwargs': {},
            },
            'dependencies': {
                'task-4': None
            },
        }
        w1 = WorkflowNode.from_dict(data_dict)

        assert w1.id == 'task-7'
        assert w1.signature.id == 'task-7'
        assert w1.dependencies == {'task-4': None}
Ejemplo n.º 2
0
    def test_from_dict_with_custom_payload(self):
        data_dict = {
            'id': 'task-7',
            'signature': {
                'options': {
                    'task_id': 'task-7'
                },
                'task': None,
                'args': (),
                'kwargs': {},
            },
            'dependencies': {
                'task-4': None
            },
            'custom_payload': {
                'foo': 42
            }
        }
        w1 = WorkflowNode.from_dict(data_dict)

        assert w1.id == 'task-7'
        assert w1.signature.id == 'task-7'
        assert w1.dependencies == {'task-4': None}
        assert w1.custom_payload['foo'] == 42