Fix style issues

This commit is contained in:
Ian Fillion-de Kiewit 2016-02-02 14:02:37 -05:00
commit 129b4faff8
21 changed files with 244 additions and 163 deletions

View file

@ -1,7 +1,6 @@
from __future__ import unicode_literals
import json
import sure
from moto.swf.exceptions import (
SWFClientError,
@ -20,6 +19,7 @@ from moto.swf.models import (
WorkflowType,
)
def test_swf_client_error():
ex = SWFClientError("ASpecificType", "error message")
@ -29,6 +29,7 @@ def test_swf_client_error():
"message": "error message"
})
def test_swf_unknown_resource_fault():
ex = SWFUnknownResourceFault("type", "detail")
@ -38,6 +39,7 @@ def test_swf_unknown_resource_fault():
"message": "Unknown type: detail"
})
def test_swf_unknown_resource_fault_with_only_one_parameter():
ex = SWFUnknownResourceFault("foo bar baz")
@ -47,6 +49,7 @@ def test_swf_unknown_resource_fault_with_only_one_parameter():
"message": "Unknown foo bar baz"
})
def test_swf_domain_already_exists_fault():
ex = SWFDomainAlreadyExistsFault("domain-name")
@ -56,6 +59,7 @@ def test_swf_domain_already_exists_fault():
"message": "domain-name"
})
def test_swf_domain_deprecated_fault():
ex = SWFDomainDeprecatedFault("domain-name")
@ -65,6 +69,7 @@ def test_swf_domain_deprecated_fault():
"message": "domain-name"
})
def test_swf_serialization_exception():
ex = SWFSerializationException("value")
@ -74,6 +79,7 @@ def test_swf_serialization_exception():
"message": "class java.lang.Foo can not be converted to an String (not a real SWF exception ; happened on: value)"
})
def test_swf_type_already_exists_fault():
wft = WorkflowType("wf-name", "wf-version")
ex = SWFTypeAlreadyExistsFault(wft)
@ -84,6 +90,7 @@ def test_swf_type_already_exists_fault():
"message": "WorkflowType=[name=wf-name, version=wf-version]"
})
def test_swf_type_deprecated_fault():
wft = WorkflowType("wf-name", "wf-version")
ex = SWFTypeDeprecatedFault(wft)
@ -94,6 +101,7 @@ def test_swf_type_deprecated_fault():
"message": "WorkflowType=[name=wf-name, version=wf-version]"
})
def test_swf_workflow_execution_already_started_fault():
ex = SWFWorkflowExecutionAlreadyStartedFault()
@ -103,6 +111,7 @@ def test_swf_workflow_execution_already_started_fault():
'message': 'Already Started',
})
def test_swf_default_undefined_fault():
ex = SWFDefaultUndefinedFault("execution_start_to_close_timeout")
@ -112,6 +121,7 @@ def test_swf_default_undefined_fault():
"message": "executionStartToCloseTimeout",
})
def test_swf_validation_exception():
ex = SWFValidationException("Invalid token")
@ -121,14 +131,15 @@ def test_swf_validation_exception():
"message": "Invalid token",
})
def test_swf_decision_validation_error():
ex = SWFDecisionValidationException([
{ "type": "null_value",
"where": "decisions.1.member.startTimerDecisionAttributes.startToFireTimeout" },
{ "type": "bad_decision_type",
"value": "FooBar",
"where": "decisions.1.member.decisionType",
"possible_values": "Foo, Bar, Baz"},
{"type": "null_value",
"where": "decisions.1.member.startTimerDecisionAttributes.startToFireTimeout"},
{"type": "bad_decision_type",
"value": "FooBar",
"where": "decisions.1.member.decisionType",
"possible_values": "Foo, Bar, Baz"},
])
ex.code.should.equal(400)
@ -137,10 +148,10 @@ def test_swf_decision_validation_error():
msg = ex.get_body()
msg.should.match(r"2 validation errors detected:")
msg.should.match(
r"Value null at 'decisions.1.member.startTimerDecisionAttributes.startToFireTimeout' "\
r"Value null at 'decisions.1.member.startTimerDecisionAttributes.startToFireTimeout' "
r"failed to satisfy constraint: Member must not be null;"
)
msg.should.match(
r"Value 'FooBar' at 'decisions.1.member.decisionType' failed to satisfy constraint: " \
r"Value 'FooBar' at 'decisions.1.member.decisionType' failed to satisfy constraint: "
r"Member must satisfy enum value set: \[Foo, Bar, Baz\]"
)