Exemple #1
0
    def test_including_workflow_from_path(self, mock_load_workflow):
        workflow = Workflow()
        target1 = workflow.target('TestTarget1', inputs=[], outputs=[])

        other_workflow = Workflow()
        target2 = other_workflow.target('TestTarget2', inputs=[], outputs=[])
        target3 = other_workflow.target('TestTarget3', inputs=[], outputs=[])

        mock_load_workflow.return_value = other_workflow

        workflow.include_path('/path/to/other_workflow.py', namespace='other')
        self.assertEqual(workflow.targets.keys(), {'TestTarget1', 'other.TestTarget2', 'other.TestTarget3'})
Exemple #2
0
    def test_including_workflow_from_path(self, mock_load_workflow):
        workflow = Workflow()
        target1 = workflow.target("TestTarget1", inputs=[], outputs=[])

        other_workflow = Workflow()
        target2 = other_workflow.target("TestTarget2", inputs=[], outputs=[])
        target3 = other_workflow.target("TestTarget3", inputs=[], outputs=[])

        mock_load_workflow.return_value = other_workflow

        workflow.include_path("/path/to/other_workflow.py", namespace="other")
        self.assertEqual(
            workflow.targets.keys(),
            {"TestTarget1", "other.TestTarget2", "other.TestTarget3"},
        )
Exemple #3
0
def test_including_workflow_from_path(mock_load_workflow):
    workflow = Workflow()
    workflow.target("TestTarget1", inputs=[], outputs=[])

    other_workflow = Workflow()
    other_workflow.target("TestTarget2", inputs=[], outputs=[])
    other_workflow.target("TestTarget3", inputs=[], outputs=[])

    mock_load_workflow.return_value = other_workflow

    workflow.include_path("/path/to/other_workflow.py", namespace="other")
    assert workflow.targets.keys() == {
        "TestTarget1",
        "other.TestTarget2",
        "other.TestTarget3",
    }