Files
8.-samopisnyy-poiskovyy-age…/tests/test_search.py
T
kuzakhmetovartur 1039c7065c
CI / build (3.1) (push) Has been cancelled
CI / build (3.11) (push) Has been cancelled
CI / build (3.8) (push) Has been cancelled
CI / build (3.9) (push) Has been cancelled
feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
2026-06-30 16:22:52 +03:00

20 lines
457 B
Python

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("")