Core: Allow same request to be made multiple times (#5837)
This commit is contained in:
parent
5d2f2bca8c
commit
79616e11e6
@ -43,18 +43,13 @@ class BotocoreStubber:
|
|||||||
|
|
||||||
response = None
|
response = None
|
||||||
response_callback = None
|
response_callback = None
|
||||||
found_index = None
|
matchers = self.methods.get(request.method, [])
|
||||||
matchers = self.methods.get(request.method)
|
|
||||||
|
|
||||||
base_url = request.url.split("?", 1)[0]
|
base_url = request.url.split("?", 1)[0]
|
||||||
for i, (pattern, callback) in enumerate(matchers): # type: ignore[arg-type]
|
for pattern, callback in matchers:
|
||||||
if pattern.match(base_url):
|
if pattern.match(base_url):
|
||||||
if found_index is None:
|
response_callback = callback
|
||||||
found_index = i
|
break
|
||||||
response_callback = callback
|
|
||||||
else:
|
|
||||||
matchers.pop(found_index)
|
|
||||||
break
|
|
||||||
|
|
||||||
if response_callback is not None:
|
if response_callback is not None:
|
||||||
for header, value in request.headers.items():
|
for header, value in request.headers.items():
|
||||||
|
@ -33,6 +33,10 @@ def test_attach_policy(iot_client, policy):
|
|||||||
res.should.have.key("policies").which.should.have.length_of(1)
|
res.should.have.key("policies").which.should.have.length_of(1)
|
||||||
res["policies"][0]["policyName"].should.equal("my-policy")
|
res["policies"][0]["policyName"].should.equal("my-policy")
|
||||||
|
|
||||||
|
res = iot_client.list_attached_policies(target=cert_arn)
|
||||||
|
res.should.have.key("policies").which.should.have.length_of(1)
|
||||||
|
res["policies"][0]["policyName"].should.equal("my-policy")
|
||||||
|
|
||||||
|
|
||||||
@mock_cognitoidentity
|
@mock_cognitoidentity
|
||||||
def test_attach_policy_to_identity(region_name, iot_client, policy):
|
def test_attach_policy_to_identity(region_name, iot_client, policy):
|
||||||
|
Loading…
Reference in New Issue
Block a user