Fix ResourceNotFoundError exception message (#3582)
* Fix ResourceNotFoundError message * Fix and update unit test for invalid `describe_identity_pool`.
This commit is contained in:
parent
6dfd64ff3c
commit
13252cc4e3
@ -45,7 +45,7 @@ class CognitoIdentityBackend(BaseBackend):
|
|||||||
identity_pool = self.identity_pools.get(identity_pool_id, None)
|
identity_pool = self.identity_pools.get(identity_pool_id, None)
|
||||||
|
|
||||||
if not identity_pool:
|
if not identity_pool:
|
||||||
raise ResourceNotFoundError(identity_pool)
|
raise ResourceNotFoundError(identity_pool_id)
|
||||||
|
|
||||||
response = json.dumps(
|
response = json.dumps(
|
||||||
{
|
{
|
||||||
|
@ -74,12 +74,12 @@ def test_describe_identity_pool():
|
|||||||
@mock_cognitoidentity
|
@mock_cognitoidentity
|
||||||
def test_describe_identity_pool_with_invalid_id_raises_error():
|
def test_describe_identity_pool_with_invalid_id_raises_error():
|
||||||
conn = boto3.client("cognito-identity", "us-west-2")
|
conn = boto3.client("cognito-identity", "us-west-2")
|
||||||
|
|
||||||
with pytest.raises(ClientError) as cm:
|
with pytest.raises(ClientError) as cm:
|
||||||
conn.describe_identity_pool(IdentityPoolId="us-west-2_non-existent")
|
conn.describe_identity_pool(IdentityPoolId="us-west-2_non-existent")
|
||||||
|
|
||||||
cm.value.operation_name.should.equal("DescribeIdentityPool")
|
cm.value.operation_name.should.equal("DescribeIdentityPool")
|
||||||
cm.value.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
cm.value.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||||
|
cm.value.response["Error"]["Message"].should.equal("us-west-2_non-existent")
|
||||||
cm.value.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
|
cm.value.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user