Example #1
0
    def test_to_dict(self, sig_factory):
        w1 = WorkflowNode(sig_factory.create())
        w2 = WorkflowNode(sig_factory.create())
        w3 = WorkflowNode(sig_factory.create())

        w1.add_dependency(w2)
        w1.add_dependency(w3)

        d = w1.to_dict()

        assert d['id'] == 'task-1'
        assert d['dependencies']
        assert d['dependencies']['task-2'] is None
        assert d['dependencies']['task-3'] is None
        assert d['signature'] is w1.signature
    def test_to_dict(self, sig_factory):
        w1 = WorkflowNode(sig_factory.create())
        w2 = WorkflowNode(sig_factory.create())
        w3 = WorkflowNode(sig_factory.create())

        w1.add_dependency(w2)
        w1.add_dependency(w3)

        w1.custom_payload["foo"] = "bar"

        d = w1.to_dict()

        assert d['id'] == 'task-1'
        assert d['dependencies']
        assert d['dependencies']['task-2'] is None
        assert d['dependencies']['task-3'] is None
        assert d['custom_payload']['foo'] == "bar"
        assert d['signature'] is w1.signature