Add a lookup test for get_or_create_shared_blob
This commit is contained in:
parent
f917de8c70
commit
ec35750f2c
1 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
from app import storage
|
||||||
from data import model, database
|
from data import model, database
|
||||||
|
|
||||||
from test.fixtures import *
|
from test.fixtures import *
|
||||||
|
@ -30,3 +31,11 @@ def test_store_blob(initialized_db):
|
||||||
assert blob_storage3.id != blob_storage.id
|
assert blob_storage3.id != blob_storage.id
|
||||||
assert blob_storage3.image_size == 1234
|
assert blob_storage3.image_size == 1234
|
||||||
assert blob_storage3.uncompressed_size == 5678
|
assert blob_storage3.uncompressed_size == 5678
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_or_create_shared_blob(initialized_db):
|
||||||
|
shared = model.blob.get_or_create_shared_blob('sha256:abcdef', 'somecontent', storage)
|
||||||
|
assert shared.content_checksum == 'sha256:abcdef'
|
||||||
|
|
||||||
|
again = model.blob.get_or_create_shared_blob('sha256:abcdef', 'somecontent', storage)
|
||||||
|
assert shared == again
|
||||||
|
|
Reference in a new issue