tests: update tests after last refactoring
This commit is contained in:
parent
41fd854c7e
commit
4e2a777860
1 changed files with 5 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
import pytest
|
import pytest
|
||||||
import cognee
|
import cognee
|
||||||
from cognee.modules.data.exceptions import SearchOnEmptyGraphError
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@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_data()
|
||||||
await cognee.prune.prune_system(metadata=True)
|
await cognee.prune.prune_system(metadata=True)
|
||||||
await cognee.add("Sample input")
|
await cognee.add("Sample input")
|
||||||
with pytest.raises(SearchOnEmptyGraphError):
|
result = await cognee.search("Sample query")
|
||||||
await cognee.search("Sample query")
|
assert result == []
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
async def test_empty_search_doesnt_raise_SearchOnEmptyGraphError():
|
async def test_empty_search_doesnt_raise_SearchOnEmptyGraphError():
|
||||||
await cognee.prune.prune_data()
|
await cognee.prune.prune_data()
|
||||||
await cognee.prune.prune_system(metadata=True)
|
await cognee.prune.prune_system(metadata=True)
|
||||||
await cognee.add("Sample input")
|
await cognee.add("Sample input")
|
||||||
await cognee.cognify()
|
await cognee.cognify()
|
||||||
try:
|
result = await cognee.search("Sample query")
|
||||||
await cognee.search("Sample query")
|
assert result != []
|
||||||
except SearchOnEmptyGraphError:
|
|
||||||
pytest.fail("Should not raise SearchOnEmptyGraphError when data was added and cognified")
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue