feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
|
||||
from src.index import search
|
||||
|
||||
|
||||
def test_search_returns_list():
|
||||
results = search("test")
|
||||
assert isinstance(results, list)
|
||||
assert len(results) == 5 # default limit
|
||||
|
||||
|
||||
def test_search_limit():
|
||||
results = search("example", limit=3)
|
||||
assert len(results) == 3
|
||||
assert results == ["example result 1", "example result 2", "example result 3"]
|
||||
|
||||
|
||||
def test_search_empty_query():
|
||||
with pytest.raises(ValueError):
|
||||
search("")
|
||||
Reference in New Issue
Block a user