Add an additional test for lookup repo blobs by digest

This commit is contained in:
Joseph Schorr 2019-02-14 11:22:06 -05:00
parent ec35750f2c
commit 7beac643ec

View file

@ -39,3 +39,11 @@ def test_get_or_create_shared_blob(initialized_db):
again = model.blob.get_or_create_shared_blob('sha256:abcdef', 'somecontent', storage) again = model.blob.get_or_create_shared_blob('sha256:abcdef', 'somecontent', storage)
assert shared == again assert shared == again
def test_lookup_repo_storages_by_content_checksum(initialized_db):
for image in database.Image.select():
found = model.storage.lookup_repo_storages_by_content_checksum(image.repository,
[image.storage.content_checksum])
assert len(found) == 1
assert found[0].content_checksum == image.storage.content_checksum