From 51c13c549ccf18e1177b8687a4506364f5ce2b81 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 5 Jul 2024 17:33:43 -0300 Subject: [PATCH] Added a new test that does not mock the retriever. --- aider/tests/test_help.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/aider/tests/test_help.py b/aider/tests/test_help.py index e7e534253..93e12c20d 100644 --- a/aider/tests/test_help.py +++ b/aider/tests/test_help.py @@ -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("", 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("", 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()