Example #1
0
    def test_tuple_binds_varargs(self):
        t1 = Task()
        t2 = Task()
        l = collections.Tuple()
        with Flow(name="test") as f:
            l.bind(t1, t2)

        assert set([t1, t2, l]) == f.tasks
        assert Edge(t1, l, key="arg_1") in f.edges
        assert Edge(t2, l, key="arg_2") in f.edges
Example #2
0
 def test_tuple_returns_a_tuple(self):
     l = collections.Tuple()
     with Flow(name="test") as f:
         l.bind(1, 2)
     assert f.run().result[l].result == (1, 2)
Example #3
0
 def test_tuple_maintains_sort_order_for_more_than_10_items(self):
     # https://github.com/PrefectHQ/prefect/issues/2451
     t = collections.Tuple()
     with Flow(name="test") as f:
         t.bind(*list(range(15)))
     assert f.run().result[t].result == tuple(range(15))