Exemplo n.º 1
0
    def test_workflow_type__diff_with_identical_workflow_type(self):
        with patch.object(
            Layer1, "describe_workflow_type", mock_describe_workflow_type,
        ):
            mocked = mock_describe_workflow_type()
            workflow_type = WorkflowType(
                self.domain,
                name=mocked["typeInfo"]["workflowType"]["name"],
                version=mocked["typeInfo"]["workflowType"]["version"],
                status=mocked["typeInfo"]["status"],
                creation_date=mocked["typeInfo"]["creationDate"],
                deprecation_date=mocked["typeInfo"]["deprecationDate"],
                task_list=mocked["configuration"]["defaultTaskList"]["name"],
                child_policy=mocked["configuration"]["defaultChildPolicy"],
                execution_timeout=mocked["configuration"][
                    "defaultExecutionStartToCloseTimeout"
                ],
                decision_tasks_timeout=mocked["configuration"][
                    "defaultTaskStartToCloseTimeout"
                ],
                description=mocked["typeInfo"]["description"],
            )

            diffs = workflow_type._diff()

            self.assertLength(diffs, 0)
Exemplo n.º 2
0
    def test_workflow_type__diff_with_identical_workflow_type(self):
        with patch.object(
                Layer1,
                'describe_workflow_type',
                mock_describe_workflow_type,
        ):
            mocked = mock_describe_workflow_type()
            workflow_type = WorkflowType(
                self.domain,
                name=mocked['typeInfo']['workflowType']['name'],
                version=mocked['typeInfo']['workflowType']['version'],
                status=mocked['typeInfo']['status'],
                creation_date=mocked['typeInfo']['creationDate'],
                deprecation_date=mocked['typeInfo']['deprecationDate'],
                task_list=mocked['configuration']['defaultTaskList']['name'],
                child_policy=mocked['configuration']['defaultChildPolicy'],
                execution_timeout=mocked['configuration']
                ['defaultExecutionStartToCloseTimeout'],
                decision_tasks_timeout=mocked['configuration']
                ['defaultTaskStartToCloseTimeout'],
                description=mocked['typeInfo']['description'],
            )

            diffs = workflow_type._diff()

            self.assertEqual(len(diffs), 0)
Exemplo n.º 3
0
    def test___diff_with_different_workflow_type(self):
        with patch.object(
            Layer1, "describe_workflow_type", mock_describe_workflow_type,
        ):
            workflow_type = WorkflowType(
                self.domain, "different-workflow-type", version="different-version"
            )
            diffs = workflow_type._diff()

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

            self.assertTrue(hasattr(diffs[0], "attr"))
            self.assertTrue(hasattr(diffs[0], "local"))
            self.assertTrue(hasattr(diffs[0], "upstream"))
Exemplo n.º 4
0
    def test___diff_with_different_workflow_type(self):
        with patch.object(
                Layer1,
                'describe_workflow_type',
                mock_describe_workflow_type,
        ):
            workflow_type = WorkflowType(self.domain,
                                         "different-workflow-type",
                                         version="different-version")
            diffs = workflow_type._diff()

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

            self.assertTrue(hasattr(diffs[0], 'attr'))
            self.assertTrue(hasattr(diffs[0], 'local'))
            self.assertTrue(hasattr(diffs[0], 'upstream'))
    def test___diff_with_different_workflow_type(self):
        with patch.object(
            Layer1,
            'describe_workflow_type',
            mock_describe_workflow_type,
        ):
            workflow_type = WorkflowType(
                self.domain,
                "different-workflow-type",
                version="different-version"
            )
            diffs = workflow_type._diff()

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

            self.assertTrue(hasattr(diffs[0], 'attr'))
            self.assertTrue(hasattr(diffs[0], 'local'))
            self.assertTrue(hasattr(diffs[0], 'upstream'))
    def test_workflow_type__diff_with_identical_workflow_type(self):
        with patch.object(
            Layer1,
            'describe_workflow_type',
            mock_describe_workflow_type,
        ):
            mocked = mock_describe_workflow_type()
            workflow_type = WorkflowType(
                self.domain,
                name=mocked['typeInfo']['workflowType']['name'],
                version=mocked['typeInfo']['workflowType']['version'],
                status=mocked['typeInfo']['status'],
                creation_date=mocked['typeInfo']['creationDate'],
                deprecation_date=mocked['typeInfo']['deprecationDate'],
                task_list=mocked['configuration']['defaultTaskList']['name'],
                child_policy=mocked['configuration']['defaultChildPolicy'],
                execution_timeout=mocked['configuration']['defaultExecutionStartToCloseTimeout'],
                decision_tasks_timeout=mocked['configuration']['defaultTaskStartToCloseTimeout'],
                description=mocked['typeInfo']['description'],
            )

            diffs = workflow_type._diff()

            self.assertEqual(len(diffs), 0)