mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
Added a new test that does not mock the retriever.
This commit is contained in:
parent
a8af4a3109
commit
51c13c549c
1 changed files with 15 additions and 1 deletions
|
@ -12,7 +12,7 @@ class TestHelp(unittest.TestCase):
|
|||
def test_init(self):
|
||||
self.assertIsNotNone(self.help.retriever)
|
||||
|
||||
def test_ask(self):
|
||||
def test_ask_with_mock(self):
|
||||
mock_node = MagicMock()
|
||||
mock_node.text = "Test content"
|
||||
mock_node.metadata = {"url": "https://example.com"}
|
||||
|
@ -25,6 +25,20 @@ class TestHelp(unittest.TestCase):
|
|||
self.assertIn("Test content", result)
|
||||
self.assertIn("</doc>", result)
|
||||
|
||||
def test_ask_without_mock(self):
|
||||
help_instance = Help()
|
||||
question = "What is aider?"
|
||||
result = help_instance.ask(question)
|
||||
|
||||
self.assertIn(f"# Question: {question}", result)
|
||||
self.assertIn("<doc", result)
|
||||
self.assertIn("</doc>", result)
|
||||
self.assertGreater(len(result), 100) # Ensure we got a substantial response
|
||||
|
||||
# Check for some expected content (adjust based on your actual help content)
|
||||
self.assertIn("aider", result.lower())
|
||||
self.assertIn("ai", result.lower())
|
||||
self.assertIn("chat", result.lower())
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue