def test__contains__success(client, database, cleanup): disk_store = DiskObjectStore(database) _id = UID() storable = StorableObject(id=_id, data=tensor1) disk_store.__setitem__(_id, storable) bin_obj = database.session.query(BinObject).get(str(_id.value)) metadata = (database.session.query(ObjectMetadata).filter_by( obj=str(_id.value)).one()) assert bin_obj is not None assert th.all(th.eq(bin_obj.object, tensor1)) assert metadata is not None assert metadata.tags == [] assert metadata.description == "" assert metadata.read_permissions == {} assert metadata.search_permissions == {} retrieved = disk_store.__contains__(_id) assert retrieved
def test__contains__fail(client, database, cleanup): disk_store = DiskObjectStore(database) _id = UID() retrieved = disk_store.__contains__(_id) assert not retrieved