From 4e2a7778600bcea3992dbec4466939022e9b53c8 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Fri, 17 Oct 2025 14:18:44 +0100 Subject: [PATCH] tests: update tests after last refactoring --- cognee/tests/unit/api/test_search.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cognee/tests/unit/api/test_search.py b/cognee/tests/unit/api/test_search.py index aff9e5d38..54a4cc35f 100644 --- a/cognee/tests/unit/api/test_search.py +++ b/cognee/tests/unit/api/test_search.py @@ -1,6 +1,5 @@ import pytest import cognee -from cognee.modules.data.exceptions import SearchOnEmptyGraphError @pytest.mark.asyncio @@ -8,16 +7,15 @@ async def test_empty_search_raises_SearchOnEmptyGraphError_on_empty_graph(): await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) await cognee.add("Sample input") - with pytest.raises(SearchOnEmptyGraphError): - await cognee.search("Sample query") + result = await cognee.search("Sample query") + assert result == [] +@pytest.mark.asyncio async def test_empty_search_doesnt_raise_SearchOnEmptyGraphError(): await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) await cognee.add("Sample input") await cognee.cognify() - try: - await cognee.search("Sample query") - except SearchOnEmptyGraphError: - pytest.fail("Should not raise SearchOnEmptyGraphError when data was added and cognified") + result = await cognee.search("Sample query") + assert result != []