This commit is contained in:
Chagui- 2019-11-22 16:34:33 -03:00
commit be605d603f
10 changed files with 17 additions and 25 deletions

View File

@ -54,7 +54,7 @@ deploy:
on: on:
branch: branch:
- master - master
cleanup: false skip_cleanup: true
skip_existing: true skip_existing: true
# - provider: pypi # - provider: pypi
# distributions: sdist bdist_wheel # distributions: sdist bdist_wheel

View File

@ -307,7 +307,7 @@ class BaseResponse(_TemplateEnvironmentMixin, ActionAuthenticatorMixin):
def _convert(elem, is_last): def _convert(elem, is_last):
if not re.match("^{.*}$", elem): if not re.match("^{.*}$", elem):
return elem return elem
name = elem.replace("{", "").replace("}", "") name = elem.replace("{", "").replace("}", "").replace("+", "")
if is_last: if is_last:
return "(?P<%s>[^/]*)" % name return "(?P<%s>[^/]*)" % name
return "(?P<%s>.*)" % name return "(?P<%s>.*)" % name

View File

@ -153,7 +153,7 @@ class DataSyncResponse(BaseResponse):
task_execution_arn = self._get_param("TaskExecutionArn") task_execution_arn = self._get_param("TaskExecutionArn")
task_execution = self.datasync_backend._get_task_execution(task_execution_arn) task_execution = self.datasync_backend._get_task_execution(task_execution_arn)
result = json.dumps( result = json.dumps(
{"TaskExecutionArn": task_execution.arn, "Status": task_execution.status,} {"TaskExecutionArn": task_execution.arn, "Status": task_execution.status}
) )
if task_execution.status == "SUCCESS": if task_execution.status == "SUCCESS":
self.datasync_backend.tasks[task_execution.task_arn].status = "AVAILABLE" self.datasync_backend.tasks[task_execution.task_arn].status = "AVAILABLE"

View File

@ -4,6 +4,4 @@ from .responses import DataSyncResponse
url_bases = ["https?://(.*?)(datasync)(.*?).amazonaws.com"] url_bases = ["https?://(.*?)(datasync)(.*?).amazonaws.com"]
url_paths = { url_paths = {"{0}/$": DataSyncResponse.dispatch}
"{0}/$": DataSyncResponse.dispatch,
}

View File

@ -316,8 +316,7 @@ class EventsBackend(BaseBackend):
if not event_bus: if not event_bus:
raise JsonRESTError( raise JsonRESTError(
"ResourceNotFoundException", "ResourceNotFoundException", "Event bus {} does not exist.".format(name)
"Event bus {} does not exist.".format(name),
) )
return event_bus return event_bus

View File

@ -261,10 +261,7 @@ class EventsHandler(BaseResponse):
name = self._get_param("Name") name = self._get_param("Name")
event_bus = self.events_backend.describe_event_bus(name) event_bus = self.events_backend.describe_event_bus(name)
response = { response = {"Name": event_bus.name, "Arn": event_bus.arn}
"Name": event_bus.name,
"Arn": event_bus.arn,
}
if event_bus.policy: if event_bus.policy:
response["Policy"] = event_bus.policy response["Policy"] = event_bus.policy
@ -285,10 +282,7 @@ class EventsHandler(BaseResponse):
response = [] response = []
for event_bus in self.events_backend.list_event_buses(name_prefix): for event_bus in self.events_backend.list_event_buses(name_prefix):
event_bus_response = { event_bus_response = {"Name": event_bus.name, "Arn": event_bus.arn}
"Name": event_bus.name,
"Arn": event_bus.arn,
}
if event_bus.policy: if event_bus.policy:
event_bus_response["Policy"] = event_bus.policy event_bus_response["Policy"] = event_bus.policy

View File

@ -563,7 +563,7 @@ def test_create_stage():
api_id = response["id"] api_id = response["id"]
create_method_integration(client, api_id) create_method_integration(client, api_id)
response = client.create_deployment(restApiId=api_id, stageName=stage_name,) response = client.create_deployment(restApiId=api_id, stageName=stage_name)
deployment_id = response["id"] deployment_id = response["id"]
response = client.get_deployment(restApiId=api_id, deploymentId=deployment_id) response = client.get_deployment(restApiId=api_id, deploymentId=deployment_id)

View File

@ -3335,7 +3335,7 @@ def test_update_item_if_original_value_is_none():
table.update_item( table.update_item(
Key={"job_id": "a"}, Key={"job_id": "a"},
UpdateExpression="SET job_name = :output", UpdateExpression="SET job_name = :output",
ExpressionAttributeValues={":output": "updated",}, ExpressionAttributeValues={":output": "updated"},
) )
table.scan()["Items"][0]["job_name"].should.equal("updated") table.scan()["Items"][0]["job_name"].should.equal("updated")
@ -3354,7 +3354,7 @@ def test_update_nested_item_if_original_value_is_none():
table.update_item( table.update_item(
Key={"job_id": "a"}, Key={"job_id": "a"},
UpdateExpression="SET job_details.job_name = :output", UpdateExpression="SET job_details.job_name = :output",
ExpressionAttributeValues={":output": "updated",}, ExpressionAttributeValues={":output": "updated"},
) )
table.scan()["Items"][0]["job_details"]["job_name"].should.equal("updated") table.scan()["Items"][0]["job_details"]["job_name"].should.equal("updated")

View File

@ -213,7 +213,7 @@ class TestEdges:
resp = conn.update_table( resp = conn.update_table(
TableName="test-streams", TableName="test-streams",
StreamSpecification={"StreamViewType": "KEYS_ONLY"}, StreamSpecification={"StreamViewType": "KEYS_ONLY", "StreamEnabled": True},
) )
assert "StreamSpecification" in resp["TableDescription"] assert "StreamSpecification" in resp["TableDescription"]
assert resp["TableDescription"]["StreamSpecification"] == { assert resp["TableDescription"]["StreamSpecification"] == {
@ -226,7 +226,10 @@ class TestEdges:
with assert_raises(conn.exceptions.ResourceInUseException): with assert_raises(conn.exceptions.ResourceInUseException):
resp = conn.update_table( resp = conn.update_table(
TableName="test-streams", TableName="test-streams",
StreamSpecification={"StreamViewType": "OLD_IMAGES"}, StreamSpecification={
"StreamViewType": "OLD_IMAGES",
"StreamEnabled": True,
},
) )
def test_stream_with_range_key(self): def test_stream_with_range_key(self):
@ -243,7 +246,7 @@ class TestEdges:
{"AttributeName": "color", "AttributeType": "S"}, {"AttributeName": "color", "AttributeType": "S"},
], ],
ProvisionedThroughput={"ReadCapacityUnits": 1, "WriteCapacityUnits": 1}, ProvisionedThroughput={"ReadCapacityUnits": 1, "WriteCapacityUnits": 1},
StreamSpecification={"StreamViewType": "NEW_IMAGES"}, StreamSpecification={"StreamViewType": "NEW_IMAGES", "StreamEnabled": True},
) )
stream_arn = resp["TableDescription"]["LatestStreamArn"] stream_arn = resp["TableDescription"]["LatestStreamArn"]

View File

@ -2526,9 +2526,7 @@ def test_get_account_summary():
) )
client.create_instance_profile(InstanceProfileName="test-profile") client.create_instance_profile(InstanceProfileName="test-profile")
client.create_open_id_connect_provider( client.create_open_id_connect_provider(Url="https://example.com", ThumbprintList=[])
Url="https://example.com", ThumbprintList=[],
)
response_policy = client.create_policy( response_policy = client.create_policy(
PolicyName="test-policy", PolicyDocument=MOCK_POLICY PolicyName="test-policy", PolicyDocument=MOCK_POLICY
) )