Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/tests/test_cookers_base.py
Show All 18 Lines | class BaseVaultCookerMock(BaseVaultCooker): | ||||
CACHE_TYPE_KEY = TEST_OBJ_TYPE | CACHE_TYPE_KEY = TEST_OBJ_TYPE | ||||
def __init__(self): | def __init__(self): | ||||
# we do not call super() here to bypass the building of db objects from | # we do not call super() here to bypass the building of db objects from | ||||
# config since we do mock these db objects | # config since we do mock these db objects | ||||
self.config = {} | self.config = {} | ||||
self.storage = MagicMock() | self.storage = MagicMock() | ||||
self.backend = MagicMock() | self.backend = MagicMock() | ||||
self.obj_type = self.CACHE_TYPE_KEY | self.bundle_type = self.CACHE_TYPE_KEY | ||||
self.obj_id = hashutil.hash_to_bytes(TEST_OBJ_ID) | self.obj_id = hashutil.hash_to_bytes(TEST_OBJ_ID) | ||||
self.max_bundle_size = 1024 | self.max_bundle_size = 1024 | ||||
def check_exists(self): | def check_exists(self): | ||||
return True | return True | ||||
def prepare_bundle(self): | def prepare_bundle(self): | ||||
for chunk in TEST_BUNDLE_CHUNKS: | for chunk in TEST_BUNDLE_CHUNKS: | ||||
Show All 39 Lines |