diff --git a/src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py b/src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py index 1ad8f213209..d3186fcc70f 100644 --- a/src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py @@ -7,7 +7,6 @@ from pony.orm import db_session from tribler.core.components.database.db.layers.knowledge_data_access_layer import KnowledgeDataAccessLayer -from tribler.core.components.database.db.tribler_database import TriblerDatabase from tribler.core.components.metadata_store.db.serialization import REGULAR_TORRENT, SNIPPET from tribler.core.components.metadata_store.restapi.search_endpoint import SearchEndpoint from tribler.core.components.restapi.rest.base_api_test import do_request @@ -221,3 +220,10 @@ def mocked_get_objects(*__, subject=None, **___) -> List[str]: # There is one item that has not been assigned to the snippet. assert results[2]["type"] == REGULAR_TORRENT assert results[2]["infohash"] == hexlify(infohashes[4]) + + +def test_build_snippets_no_infohash(endpoint: SearchEndpoint): + """ Test building snippets without infohash. The `build_snippets` should return the same results.""" + search_results = [{'dictionary': 'without infohash'}] + result = endpoint.build_snippets(search_results) + assert result == search_results