def test_domain__diff_with_different_domain(self):
        with patch.object(Layer1, "describe_domain", mock_describe_domain):
            domain = Domain("different-domain", status=DEPRECATED, description="blabla")
            diffs = domain._diff()

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

            self.assertTrue(hasattr(diffs[0], "attr"))
            self.assertTrue(hasattr(diffs[0], "local"))
            self.assertTrue(hasattr(diffs[0], "upstream"))
    def test_domain__diff_with_identical_domain(self):
        with patch.object(Layer1, "describe_domain", mock_describe_domain):
            mocked = mock_describe_domain()
            domain = Domain(
                mocked["domainInfo"]["name"],
                status=mocked["domainInfo"]["status"],
                description=mocked["domainInfo"]["description"],
                retention_period=mocked["configuration"]["workflowExecutionRetentionPeriodInDays"],
            )

            diffs = domain._diff()

            self.assertEqual(len(diffs), 0)
Esempio n. 3
0
    def test_domain__diff_with_different_domain(self):
        with patch.object(
            Layer1, "describe_domain", mock_describe_domain,
        ):
            domain = Domain("different-domain", status=DEPRECATED, description="blabla")
            diffs = domain._diff()

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

            self.assertTrue(hasattr(diffs[0], "attr"))
            self.assertTrue(hasattr(diffs[0], "local"))
            self.assertTrue(hasattr(diffs[0], "upstream"))
Esempio n. 4
0
    def test_domain__diff_with_identical_domain(self):
        with patch.object(
                Layer1,
                'describe_domain',
                mock_describe_domain,
        ):
            mocked = mock_describe_domain()
            domain = Domain(mocked['domainInfo']['name'],
                            status=mocked['domainInfo']['status'],
                            description=mocked['domainInfo']['description'],
                            retention_period=mocked['configuration']
                            ['workflowExecutionRetentionPeriodInDays'])

            diffs = domain._diff()

            self.assertEqual(len(diffs), 0)
    def test_domain__diff_with_identical_domain(self):
        with patch.object(
            Layer1,
            'describe_domain',
            mock_describe_domain,
        ):
            mocked = mock_describe_domain()
            domain = Domain(
                mocked['domainInfo']['name'],
                status=mocked['domainInfo']['status'],
                description=mocked['domainInfo']['description'],
                retention_period=mocked['configuration']['workflowExecutionRetentionPeriodInDays']
            )

            diffs = domain._diff()

            self.assertEqual(len(diffs), 0)
Esempio n. 6
0
    def test_domain__diff_with_identical_domain(self):
        with patch.object(
            Layer1, "describe_domain", mock_describe_domain,
        ):
            mocked = mock_describe_domain()
            domain = Domain(
                mocked["domainInfo"]["name"],
                status=mocked["domainInfo"]["status"],
                description=mocked["domainInfo"]["description"],
                retention_period=mocked["configuration"][
                    "workflowExecutionRetentionPeriodInDays"
                ],
            )

            diffs = domain._diff()

            self.assertEqual(len(diffs), 0)