Skip to content

Commit

Permalink
Merge pull request #7667 from drew2a/feature/tests_for_7578
Browse files Browse the repository at this point in the history
Add test for #7578
  • Loading branch information
drew2a committed Nov 7, 2023
2 parents e8c915b + a6a6631 commit 0262d1e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 0262d1e

Please sign in to comment.