Merge pull request #2786 from meeuw/bugfix/ecr-imagenotfoundexception

Change RESTError to JsonRESTError for ImageNotFoundException
This commit is contained in:
Bert Blommers 2020-03-09 08:44:57 +00:00 committed by GitHub
commit 40b4e299ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
from __future__ import unicode_literals
from moto.core.exceptions import RESTError
from moto.core.exceptions import RESTError, JsonRESTError
class RepositoryNotFoundException(RESTError):
@ -13,7 +13,7 @@ class RepositoryNotFoundException(RESTError):
)
class ImageNotFoundException(RESTError):
class ImageNotFoundException(JsonRESTError):
code = 400
def __init__(self, image_id, repository_name, registry_id):

View File

@ -538,7 +538,7 @@ def test_describe_image_that_doesnt_exist():
repositoryName="test_repository",
imageIds=[{"imageTag": "testtag"}],
registryId="123",
).should.throw(ClientError, error_msg1)
).should.throw(client.exceptions.ImageNotFoundException, error_msg1)
error_msg2 = re.compile(
r".*The repository with name 'repo-that-doesnt-exist' does not exist in the registry with id '123'.*",