def test_assert_dag_straight_line_pipeline(self): pipeline = Pipeline("straight_line") pipeline.add_state(PipelineState("state1", {}), is_starting=True) pipeline.add_state(PipelineState("state2", {})) pipeline.add_state(PipelineState("state3", {})) pipeline.add_worker(self.create_demo_worker_instance("state1", {"state2"})) pipeline.add_mod_view( PipelineModView( "2to3", "state2", [PipelineModViewToState("state3", "state3")], [], "" ) ) pipeline.assert_pipeline_is_dag()
def test_assert_dag_simple_pipeline(self): pipeline = Pipeline("simple") pipeline.add_state(PipelineState("state1", {}), is_starting=True) pipeline.add_state(PipelineState("state2", {})) pipeline.add_state(PipelineState("state3", {})) pipeline.add_state(PipelineState("state4", {})) pipeline.add_state(PipelineState("state5", {})) pipeline.add_worker(self.create_demo_worker_instance("state1", {"state2"})) pipeline.add_worker(self.create_demo_worker_instance("state2", {"state3"})) pipeline.add_worker(self.create_demo_worker_instance("state2", {"state4"})) pipeline.add_worker(self.create_demo_worker_instance("state3", {"state4"})) pipeline.add_worker(self.create_demo_worker_instance("state4", {"state5"})) pipeline.assert_pipeline_is_dag()