Esempio n. 1
0
 def test_get_non_existent_domain(self):
     with patch.object(self.qs.connection, 'describe_domain') as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(
                 400, "mocking exception",
                 {'__type': 'UnknownResourceFault'})
             self.qs.get('non_existent')
Esempio n. 2
0
 def test_get_domain_with_invalid_credentials(self):
     with patch.object(self.qs.connection, 'describe_domain') as mock:
         with self.assertRaises(InvalidCredentialsError):
             mock.side_effect = SWFResponseError(
                 400, "mocking exception",
                 {'__type': 'UnrecognizedClientException'})
             self.qs.get('non_existent')
Esempio n. 3
0
 def test_domain_exists_with_whatever_error(self):
     with patch.object(self.domain.connection, 'describe_domain') as mock:
         with self.assertRaises(ResponseError):
             mock.side_effect = SWFResponseError(400, "mocking exception", {
                 '__type': 'WhateverError',
                 'message': 'Whatever'
             })
             dummy = self.domain.exists
Esempio n. 4
0
 def test_delete_non_existent_type(self):
     with patch.object(self.wt.connection,
                       'deprecate_workflow_type') as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(400, "mocked exception", {
                 "__type": "UnknownResourceFault",
                 "message": "Whatever"
             })
             self.wt.delete()
Esempio n. 5
0
 def test_get_with_non_existent_version(self):
     """Asserts get method with non existent activity type version provided raises"""
     with patch.object(self.atq.connection,
                       "describe_activity_type") as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(
                 400, "mocking exception",
                 {"__type": "UnknownResourceFault"})
             self.atq.get("mocked-non-existent-activity-type-name", "na")
Esempio n. 6
0
 def test_get_with_non_existent_name(self):
     """Asserts get method with non existent activity type name provided raises"""
     with patch.object(self.atq.connection,
                       'describe_activity_type') as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(
                 400, 'mocking exception',
                 {'__type': 'UnknownResourceFault'})
             self.atq.get('mocked-non-existent-activity-type-name', '0.1')
Esempio n. 7
0
 def test_get_raising_domain(self):
     with patch.object(self.qs.connection, "describe_domain") as mock:
         with self.assertRaises(ResponseError):
             mock.side_effect = SWFResponseError(
                 400,
                 "mocking exception",
                 {"__type": "WhateverError", "message": "WhateverMessage",},
             )
             self.qs.get("whatever")
Esempio n. 8
0
 def test_save_with_response_error(self):
     with patch.object(self.wt.connection, "register_workflow_type") as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(
                 400,
                 "mocked exception",
                 {"__type": "UnknownResourceFault", "message": "Whatever"},
             )
             self.wt.save()
Esempio n. 9
0
 def test_delete_deprecated_type(self):
     with patch.object(self.wt.connection, "deprecate_workflow_type") as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(
                 400,
                 "mocked exception",
                 {"__type": "TypeDeprecatedFault", "message": "Whatever"},
             )
             self.wt.delete()
Esempio n. 10
0
 def test_get_raising_domain(self):
     with patch.object(self.qs.connection, 'describe_domain') as mock:
         with self.assertRaises(ResponseError):
             mock.side_effect = SWFResponseError(
                 400, "mocking exception", {
                     '__type': 'WhateverError',
                     'message': 'WhateverMessage',
                 })
             self.qs.get('whatever')
Esempio n. 11
0
 def test_get_non_existent_workflow_type(self):
     with patch.object(self.wtq.connection,
                       'describe_workflow_type') as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(400, "mocked exception", {
                 "__type": "UnknownResourceFault",
                 "message": "Whatever",
             })
             self.wtq.get("NonExistentWorkflowType", "0.1")
Esempio n. 12
0
 def test_get_whatever_failing_workflow_type(self):
     with patch.object(self.wtq.connection,
                       'describe_workflow_type') as mock:
         with self.assertRaises(ResponseError):
             mock.side_effect = SWFResponseError(400, "mocked exception", {
                 "__type": "Whatever Error",
                 "message": "Whatever",
             })
             self.wtq.get("NonExistentWorkflowType", "0.1")
Esempio n. 13
0
 def test_get_invalid_workflow_execution(self):
     with patch.object(self.weq.connection,
                       'describe_workflow_execution') as mock:
         with self.assertRaises(ResponseError):
             mock.side_effect = SWFResponseError(400, "mocked exception", {
                 "__type": "WhateverFault",
                 "message": "Whatever",
             })
             self.weq.get("mocked-workflow-id", "mocked-run-id")
Esempio n. 14
0
 def test_workflow_execution_exists_with_whatever_error(self):
     with patch.object(self.we.connection, "describe_workflow_execution") as mock:
         with self.assertRaises(ResponseError):
             mock.side_effect = SWFResponseError(
                 400,
                 "mocking exception",
                 {"__type": "WhateverError", "message": "Whatever"},
             )
             dummy = self.domain.exists
Esempio n. 15
0
    def test_get_with_failing_activity_type(self):
        """Asserts get method over a failing activity type raises"""
        with patch.object(self.atq.connection,
                          'describe_activity_type') as mock:
            with self.assertRaises(ResponseError):
                mock.side_effect = SWFResponseError(
                    400, 'mocking exception',
                    {'__type': 'UnrecognizedClientException'})

                self.atq.get('mocked-failing-activity-type', '0.1')
Esempio n. 16
0
    def test_get_with_failing_activity_type(self):
        """Asserts get method over a failing activity type raises"""
        with patch.object(self.atq.connection,
                          "describe_activity_type") as mock:
            with self.assertRaises(ResponseError):
                mock.side_effect = SWFResponseError(
                    400, "mocking exception",
                    {"__type": "UnrecognizedClientException"})

                self.atq.get("mocked-failing-activity-type", "0.1")
Esempio n. 17
0
    def test_exists_with_non_existent_workflow_type(self):
        with patch.object(self.wt.connection, 'describe_workflow_type') as mock:
            mock.side_effect = SWFResponseError(
                400,
                "Bad Request:",
                {'__type': 'com.amazonaws.swf.base.model#UnknownResourceFault',
                 'message': 'Unknown type: WorkflowType=[workflowId=blah, runId=test]'},
                'UnknownResourceFault',
            )

            self.assertFalse(self.wt.exists)
Esempio n. 18
0
 def test_domain_delete_non_existent_domain(self):
     with patch.object(self.domain.connection, "deprecate_domain") as mock:
         with self.assertRaises(DomainDoesNotExist):
             mock.side_effect = SWFResponseError(
                 400,
                 "Bad Request",
                 {
                     "message": "Unknown domain: does not exist",
                     "__type": "com.amazonaws.swf.base.model#UnknownResourceFault",
                 },
                 "UnknownResourceFault",
             )
             self.domain.delete()
Esempio n. 19
0
 def test_get_non_existent_workflow_execution(self):
     with patch.object(self.weq.connection,
                       "describe_workflow_execution") as mock:
         with self.assertRaises(DoesNotExistError):
             mock.side_effect = SWFResponseError(
                 400,
                 "mocked exception",
                 {
                     "__type": "UnknownResourceFault",
                     "message": "Whatever",
                 },
             )
             self.weq.get("mocked-workflow-id", "mocked-run-id")
Esempio n. 20
0
    def test_exists_with_non_existent_workflow_execution(self):
        with patch.object(self.we.connection, "describe_workflow_execution") as mock:
            mock.side_effect = SWFResponseError(
                400,
                "Bad Request:",
                {
                    "__type": "com.amazonaws.swf.base.model#UnknownResourceFault",
                    "message": "Unknown execution: WorkflowExecution=[workflowId=blah, runId=test]",
                },
                "UnknownResourceFault",
            )

            self.assertFalse(self.we.exists)
Esempio n. 21
0
    def test_domain_exists_with_non_existent_domain(self):
        with patch.object(self.domain.connection, "describe_domain") as mock:
            mock.side_effect = SWFResponseError(
                400,
                "Bad Request",
                {
                    "message": "Unknown domain: does not exist",
                    "__type": "com.amazonaws.swf.base.model#UnknownResourceFault",
                },
                "UnknownResourceFault",
            )

            self.assertFalse(self.domain.exists)