コード例 #1
0
ファイル: test_domain.py プロジェクト: xzased/simpleflow
 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')
コード例 #2
0
ファイル: test_domain.py プロジェクト: xzased/simpleflow
 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')
コード例 #3
0
ファイル: test_domain.py プロジェクト: komin92/simpleflow
 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
コード例 #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()
コード例 #5
0
ファイル: test_activity.py プロジェクト: ybastide/simpleflow
 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")
コード例 #6
0
ファイル: test_activity.py プロジェクト: xzased/simpleflow
 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')
コード例 #7
0
ファイル: test_domain.py プロジェクト: ybastide/simpleflow
 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")
コード例 #8
0
ファイル: test_workflow.py プロジェクト: ybastide/simpleflow
 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()
コード例 #9
0
ファイル: test_workflow.py プロジェクト: ybastide/simpleflow
 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()
コード例 #10
0
ファイル: test_domain.py プロジェクト: xzased/simpleflow
 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')
コード例 #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")
コード例 #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")
コード例 #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")
コード例 #14
0
ファイル: test_workflow.py プロジェクト: ybastide/simpleflow
 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
コード例 #15
0
ファイル: test_activity.py プロジェクト: xzased/simpleflow
    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')
コード例 #16
0
ファイル: test_activity.py プロジェクト: ybastide/simpleflow
    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")
コード例 #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)
コード例 #18
0
ファイル: test_domain.py プロジェクト: ybastide/simpleflow
 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()
コード例 #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")
コード例 #20
0
ファイル: test_workflow.py プロジェクト: ybastide/simpleflow
    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)
コード例 #21
0
ファイル: test_domain.py プロジェクト: ybastide/simpleflow
    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)