Example #1
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.assertLength(diffs, 7)

            self.assertTrue(hasattr(diffs[0], "attr"))
            self.assertTrue(hasattr(diffs[0], "local"))
            self.assertTrue(hasattr(diffs[0], "upstream"))
Example #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'))
    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'))
Example #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)
    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)
Example #6
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)