Merge branch 'master' of https://github.com/spulec/moto
This commit is contained in:
commit
be605d603f
@ -54,7 +54,7 @@ deploy:
|
||||
on:
|
||||
branch:
|
||||
- master
|
||||
cleanup: false
|
||||
skip_cleanup: true
|
||||
skip_existing: true
|
||||
# - provider: pypi
|
||||
# distributions: sdist bdist_wheel
|
||||
|
@ -307,7 +307,7 @@ class BaseResponse(_TemplateEnvironmentMixin, ActionAuthenticatorMixin):
|
||||
def _convert(elem, is_last):
|
||||
if not re.match("^{.*}$", elem):
|
||||
return elem
|
||||
name = elem.replace("{", "").replace("}", "")
|
||||
name = elem.replace("{", "").replace("}", "").replace("+", "")
|
||||
if is_last:
|
||||
return "(?P<%s>[^/]*)" % name
|
||||
return "(?P<%s>.*)" % name
|
||||
|
@ -153,7 +153,7 @@ class DataSyncResponse(BaseResponse):
|
||||
task_execution_arn = self._get_param("TaskExecutionArn")
|
||||
task_execution = self.datasync_backend._get_task_execution(task_execution_arn)
|
||||
result = json.dumps(
|
||||
{"TaskExecutionArn": task_execution.arn, "Status": task_execution.status,}
|
||||
{"TaskExecutionArn": task_execution.arn, "Status": task_execution.status}
|
||||
)
|
||||
if task_execution.status == "SUCCESS":
|
||||
self.datasync_backend.tasks[task_execution.task_arn].status = "AVAILABLE"
|
||||
|
@ -4,6 +4,4 @@ from .responses import DataSyncResponse
|
||||
|
||||
url_bases = ["https?://(.*?)(datasync)(.*?).amazonaws.com"]
|
||||
|
||||
url_paths = {
|
||||
"{0}/$": DataSyncResponse.dispatch,
|
||||
}
|
||||
url_paths = {"{0}/$": DataSyncResponse.dispatch}
|
||||
|
@ -316,8 +316,7 @@ class EventsBackend(BaseBackend):
|
||||
|
||||
if not event_bus:
|
||||
raise JsonRESTError(
|
||||
"ResourceNotFoundException",
|
||||
"Event bus {} does not exist.".format(name),
|
||||
"ResourceNotFoundException", "Event bus {} does not exist.".format(name)
|
||||
)
|
||||
|
||||
return event_bus
|
||||
|
@ -261,10 +261,7 @@ class EventsHandler(BaseResponse):
|
||||
name = self._get_param("Name")
|
||||
|
||||
event_bus = self.events_backend.describe_event_bus(name)
|
||||
response = {
|
||||
"Name": event_bus.name,
|
||||
"Arn": event_bus.arn,
|
||||
}
|
||||
response = {"Name": event_bus.name, "Arn": event_bus.arn}
|
||||
|
||||
if event_bus.policy:
|
||||
response["Policy"] = event_bus.policy
|
||||
@ -285,10 +282,7 @@ class EventsHandler(BaseResponse):
|
||||
|
||||
response = []
|
||||
for event_bus in self.events_backend.list_event_buses(name_prefix):
|
||||
event_bus_response = {
|
||||
"Name": event_bus.name,
|
||||
"Arn": event_bus.arn,
|
||||
}
|
||||
event_bus_response = {"Name": event_bus.name, "Arn": event_bus.arn}
|
||||
|
||||
if event_bus.policy:
|
||||
event_bus_response["Policy"] = event_bus.policy
|
||||
|
@ -563,7 +563,7 @@ def test_create_stage():
|
||||
api_id = response["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"]
|
||||
|
||||
response = client.get_deployment(restApiId=api_id, deploymentId=deployment_id)
|
||||
|
@ -3335,7 +3335,7 @@ def test_update_item_if_original_value_is_none():
|
||||
table.update_item(
|
||||
Key={"job_id": "a"},
|
||||
UpdateExpression="SET job_name = :output",
|
||||
ExpressionAttributeValues={":output": "updated",},
|
||||
ExpressionAttributeValues={":output": "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(
|
||||
Key={"job_id": "a"},
|
||||
UpdateExpression="SET job_details.job_name = :output",
|
||||
ExpressionAttributeValues={":output": "updated",},
|
||||
ExpressionAttributeValues={":output": "updated"},
|
||||
)
|
||||
table.scan()["Items"][0]["job_details"]["job_name"].should.equal("updated")
|
||||
|
||||
|
@ -213,7 +213,7 @@ class TestEdges:
|
||||
|
||||
resp = conn.update_table(
|
||||
TableName="test-streams",
|
||||
StreamSpecification={"StreamViewType": "KEYS_ONLY"},
|
||||
StreamSpecification={"StreamViewType": "KEYS_ONLY", "StreamEnabled": True},
|
||||
)
|
||||
assert "StreamSpecification" in resp["TableDescription"]
|
||||
assert resp["TableDescription"]["StreamSpecification"] == {
|
||||
@ -226,7 +226,10 @@ class TestEdges:
|
||||
with assert_raises(conn.exceptions.ResourceInUseException):
|
||||
resp = conn.update_table(
|
||||
TableName="test-streams",
|
||||
StreamSpecification={"StreamViewType": "OLD_IMAGES"},
|
||||
StreamSpecification={
|
||||
"StreamViewType": "OLD_IMAGES",
|
||||
"StreamEnabled": True,
|
||||
},
|
||||
)
|
||||
|
||||
def test_stream_with_range_key(self):
|
||||
@ -243,7 +246,7 @@ class TestEdges:
|
||||
{"AttributeName": "color", "AttributeType": "S"},
|
||||
],
|
||||
ProvisionedThroughput={"ReadCapacityUnits": 1, "WriteCapacityUnits": 1},
|
||||
StreamSpecification={"StreamViewType": "NEW_IMAGES"},
|
||||
StreamSpecification={"StreamViewType": "NEW_IMAGES", "StreamEnabled": True},
|
||||
)
|
||||
stream_arn = resp["TableDescription"]["LatestStreamArn"]
|
||||
|
||||
|
@ -2526,9 +2526,7 @@ def test_get_account_summary():
|
||||
)
|
||||
|
||||
client.create_instance_profile(InstanceProfileName="test-profile")
|
||||
client.create_open_id_connect_provider(
|
||||
Url="https://example.com", ThumbprintList=[],
|
||||
)
|
||||
client.create_open_id_connect_provider(Url="https://example.com", ThumbprintList=[])
|
||||
response_policy = client.create_policy(
|
||||
PolicyName="test-policy", PolicyDocument=MOCK_POLICY
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user