Beispiel #1
0
    def test_list_binds_varargs(self):
        t1 = Task()
        t2 = Task()
        l = collections.List()
        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
Beispiel #2
0
 def test_list_returns_a_list(self):
     l = collections.List()
     with Flow(name="test") as f:
         l.bind(1, 2)
     assert f.run().result[l].result == [1, 2]
 def test_list_maintains_sort_order_for_more_than_10_items(self):
     # https://github.com/PrefectHQ/prefect/issues/2451
     l = collections.List()
     with Flow(name="test") as f:
         l.bind(*list(range(15)))
     assert f.run().result[l].result == list(range(15))