Merge pull request #129 from bucolucas/enhance-unit-tests-issue-118

Enhance unit tests for BaseTelegramInferenceBot
This commit is contained in:
2024-08-20 17:47:38 -05:00
committed by GitHub
@@ -11,7 +11,23 @@ class TestBaseTelegramInferenceBot(unittest.TestCase):
result = self.bot.load_system_prompt() result = self.bot.load_system_prompt()
self.assertIsNotNone(result) # Replace with actual expected result self.assertIsNotNone(result) # Replace with actual expected result
# Additional test cases can be added here def test_load_functions(self):
# Test the load_functions method
functions = self.bot.load_functions()
self.assertIsInstance(functions, list) # Replace with actual expected result
self.assertTrue(len(functions) > 0) # Assuming it should load some functions
def test_clear_conversation(self):
# Test the clear_conversation method
self.bot.clear_conversation()
self.assertEqual(self.bot.conversations, {}) # Assuming conversations is a dictionary
def test_call_tool(self):
# Test the call_tool method
tool_name = "some_tool"
params = {"param1": "value1"}
result = self.bot.call_tool(tool_name, params)
self.assertIsNotNone(result) # Replace with actual expected result
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()