Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_filter.py
# Copyright (C) 2019 The Software Heritage developers | # Copyright (C) 2019-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from swh.storage.filter import FilteringProxyStorage | from swh.storage.filter import FilteringProxyStorage | ||||
Show All 11 Lines | def test_filtering_proxy_storage_content(sample_data): | ||||
} | } | ||||
content = next(storage.content_get([sample_content['sha1']])) | content = next(storage.content_get([sample_content['sha1']])) | ||||
assert content is not None | assert content is not None | ||||
s = storage.content_add([sample_content]) | s = storage.content_add([sample_content]) | ||||
assert s == { | assert s == { | ||||
'content:add': 0, | 'content:add': 0, | ||||
'content:add:bytes': 0, | |||||
} | } | ||||
def test_filtering_proxy_storage_skipped_content(sample_data): | def test_filtering_proxy_storage_skipped_content(sample_data): | ||||
sample_content = sample_data['skipped_content'][0] | sample_content = sample_data['skipped_content'][0] | ||||
storage = FilteringProxyStorage(storage={'cls': 'memory'}) | storage = FilteringProxyStorage(storage={'cls': 'memory'}) | ||||
content = next(storage.skipped_content_missing([sample_content])) | content = next(storage.skipped_content_missing([sample_content])) | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |