Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_filter.py
Show All 17 Lines | def swh_storage(): | ||||
} | } | ||||
return get_storage(**storage_config) | return get_storage(**storage_config) | ||||
def test_filtering_proxy_storage_content(swh_storage, sample_data): | def test_filtering_proxy_storage_content(swh_storage, sample_data): | ||||
sample_content = sample_data.content | sample_content = sample_data.content | ||||
content = next(swh_storage.content_get([sample_content.sha1])) | content = swh_storage.content_get_data(sample_content.sha1) | ||||
assert not content | assert content is None | ||||
s = swh_storage.content_add([sample_content]) | s = swh_storage.content_add([sample_content]) | ||||
assert s == { | assert s == { | ||||
"content:add": 1, | "content:add": 1, | ||||
"content:add:bytes": sample_content.length, | "content:add:bytes": sample_content.length, | ||||
} | } | ||||
content = next(swh_storage.content_get([sample_content.sha1])) | content = swh_storage.content_get_data(sample_content.sha1) | ||||
assert content is not None | assert content is not None | ||||
s = swh_storage.content_add([sample_content]) | s = swh_storage.content_add([sample_content]) | ||||
assert s == { | assert s == { | ||||
"content:add": 0, | "content:add": 0, | ||||
"content:add:bytes": 0, | "content:add:bytes": 0, | ||||
} | } | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |