feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'

This commit is contained in:
2026-06-30 14:52:37 +03:00
parent 4be7a21036
commit b5a9604f58
4 changed files with 244 additions and 47 deletions
+21
View File
@@ -0,0 +1,21 @@
import unittest
from src.index import DuckDuckGoSearchTool
class TestSearchTool(unittest.TestCase):
def setUp(self):
self.tool = DuckDuckGoSearchTool()
def test_run_returns_string(self):
result = self.tool.run("Python programming language")
self.assertIsInstance(result, str)
self.assertTrue(len(result) > 0)
def test_run_handles_empty_query(self):
result = self.tool.run("")
self.assertIsInstance(result, str)
self.assertTrue(len(result) > 0)
if __name__ == "__main__":
unittest.main()