feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user