コード例 #1
0
ファイル: test_workflow.py プロジェクト: ybastide/simpleflow
    def test___diff_with_different_workflow_execution(self):
        with patch.object(
            Layer1, "describe_workflow_execution", mock_describe_workflow_execution,
        ):
            workflow_execution = WorkflowExecution(
                self.domain,
                WorkflowType(self.domain, "NonExistentTestType", "1.0"),
                "non-existent-id",
            )
            diffs = workflow_execution._diff()

            self.assertIsNotNone(diffs)
            self.assertLength(diffs, 7)

            self.assertTrue(hasattr(diffs[0], "attr"))
            self.assertTrue(hasattr(diffs[0], "local"))
            self.assertTrue(hasattr(diffs[0], "upstream"))
コード例 #2
0
    def test___diff_with_different_workflow_execution(self):
        with patch.object(
                Layer1,
                'describe_workflow_execution',
                mock_describe_workflow_execution,
        ):
            workflow_execution = WorkflowExecution(
                self.domain,
                WorkflowType(self.domain, "NonExistentTestType", "1.0"),
                "non-existent-id")
            diffs = workflow_execution._diff()

            self.assertIsNotNone(diffs)
            self.assertEqual(len(diffs), 7)

            self.assertTrue(hasattr(diffs[0], 'attr'))
            self.assertTrue(hasattr(diffs[0], 'local'))
            self.assertTrue(hasattr(diffs[0], 'upstream'))
コード例 #3
0
    def test___diff_with_different_workflow_execution(self):
        with patch.object(
            Layer1,
            'describe_workflow_execution',
            mock_describe_workflow_execution,
        ):
            workflow_execution = WorkflowExecution(
                self.domain,
                WorkflowType(self.domain, "NonExistentTestType", "1.0"),
                "non-existent-id"
            )
            diffs = workflow_execution._diff()

            self.assertIsNotNone(diffs)
            self.assertEqual(len(diffs), 7)

            self.assertTrue(hasattr(diffs[0], 'attr'))
            self.assertTrue(hasattr(diffs[0], 'local'))
            self.assertTrue(hasattr(diffs[0], 'upstream'))
コード例 #4
0
    def test_workflow_execution__diff_with_identical_workflow_execution(self):
        with patch.object(
                Layer1,
                'describe_workflow_execution',
                mock_describe_workflow_execution,
        ):
            mocked = mock_describe_workflow_execution()
            workflow_execution = WorkflowExecution(
                self.domain,
                mocked['executionInfo']['execution']['workflowId'],
                run_id=mocked['executionInfo']['execution']['runId'],
                status=mocked['executionInfo']['executionStatus'],
                task_list=mocked['executionConfiguration']['taskList']['name'],
                child_policy=mocked['executionConfiguration']['childPolicy'],
                execution_timeout=mocked['executionConfiguration']['executionStartToCloseTimeout'],
                tag_list=mocked['executionInfo']['tagList'],
                decision_tasks_timeout=mocked['executionConfiguration']['taskStartToCloseTimeout'],
            )

            diffs = workflow_execution._diff()

            self.assertLength(diffs, 0)
コード例 #5
0
    def test_workflow_execution__diff_with_identical_workflow_execution(self):
        with patch.object(
            Layer1,
            'describe_workflow_execution',
            mock_describe_workflow_execution,
        ):
            mocked = mock_describe_workflow_execution()
            workflow_execution = WorkflowExecution(
                self.domain,
                mocked['executionInfo']['execution']['workflowId'],
                run_id=mocked['executionInfo']['execution']['runId'],
                status=mocked['executionInfo']['executionStatus'],
                task_list=mocked['executionConfiguration']['taskList']['name'],
                child_policy=mocked['executionConfiguration']['childPolicy'],
                execution_timeout=mocked['executionConfiguration']['executionStartToCloseTimeout'],
                tag_list=mocked['executionInfo']['tagList'],
                decision_tasks_timeout=mocked['executionConfiguration']['taskStartToCloseTimeout'],
            )

            diffs = workflow_execution._diff()

            self.assertEqual(len(diffs), 0)
コード例 #6
0
ファイル: test_workflow.py プロジェクト: ybastide/simpleflow
    def test_workflow_execution__diff_with_identical_workflow_execution(self):
        with patch.object(
            Layer1, "describe_workflow_execution", mock_describe_workflow_execution,
        ):
            mocked = mock_describe_workflow_execution()
            workflow_execution = WorkflowExecution(
                self.domain,
                mocked["executionInfo"]["execution"]["workflowId"],
                run_id=mocked["executionInfo"]["execution"]["runId"],
                status=mocked["executionInfo"]["executionStatus"],
                task_list=mocked["executionConfiguration"]["taskList"]["name"],
                child_policy=mocked["executionConfiguration"]["childPolicy"],
                execution_timeout=mocked["executionConfiguration"][
                    "executionStartToCloseTimeout"
                ],
                tag_list=mocked["executionInfo"]["tagList"],
                decision_tasks_timeout=mocked["executionConfiguration"][
                    "taskStartToCloseTimeout"
                ],
            )

            diffs = workflow_execution._diff()

            self.assertLength(diffs, 0)