Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/data.py
Show First 20 Lines • Show All 281 Lines • ▼ Show 20 Lines | for content in result: | ||||
contents.append(content_metadata) | contents.append(content_metadata) | ||||
# Create indexer storage instance that will be shared by indexers | # Create indexer storage instance that will be shared by indexers | ||||
idx_storage = get_indexer_storage("memory", {}) | idx_storage = get_indexer_storage("memory", {}) | ||||
# Add the empty directory to the test archive | # Add the empty directory to the test archive | ||||
storage.directory_add([Directory(entries=())]) | storage.directory_add([Directory(entries=())]) | ||||
# Add empty content to the test archive | |||||
storage.content_add([Content.from_data(data=b"")]) | |||||
# Return tests data | # Return tests data | ||||
return { | return { | ||||
"search": search, | "search": search, | ||||
"storage": storage, | "storage": storage, | ||||
"idx_storage": idx_storage, | "idx_storage": idx_storage, | ||||
"origins": _TEST_ORIGINS, | "origins": _TEST_ORIGINS, | ||||
"contents": contents, | "contents": contents, | ||||
"directories": list(directories), | "directories": list(directories), | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |