ecr: Fix "imageDigest" value in ecr.list_images() response (#3436)

This commit is contained in:
Peter Lithammer 2020-11-05 15:10:23 +01:00 committed by GitHub
parent 574f46e212
commit b7cf2d4478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -164,7 +164,7 @@ class Image(BaseObject):
def response_list_object(self):
response_object = self.gen_response_object()
response_object["imageTag"] = self.image_tag
response_object["imageDigest"] = "i don't know"
response_object["imageDigest"] = self.get_image_digest()
return {
k: v for k, v in response_object.items() if v is not None and v != [None]
}

View File

@ -318,6 +318,9 @@ def test_list_images():
type(response["imageIds"]).should.be(list)
len(response["imageIds"]).should.be(3)
for image in response["imageIds"]:
image["imageDigest"].should.contain("sha")
image_tags = ["latest", "v1", "v2"]
set(
[
@ -331,6 +334,7 @@ def test_list_images():
type(response["imageIds"]).should.be(list)
len(response["imageIds"]).should.be(1)
response["imageIds"][0]["imageTag"].should.equal("oldest")
response["imageIds"][0]["imageDigest"].should.contain("sha")
@mock_ecr