21 lines
564 B
Python
21 lines
564 B
Python
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() |