Expand unit tests for BaseTelegramInferenceBot
- Added test cases for load_functions method - Added test cases for clear_conversation method - Added test cases for call_tool method
This commit is contained in:
@@ -10,8 +10,24 @@ class TestBaseTelegramInferenceBot(unittest.TestCase):
|
||||
# Example test case for load_system_prompt method
|
||||
result = self.bot.load_system_prompt()
|
||||
self.assertIsNotNone(result) # Replace with actual expected result
|
||||
|
||||
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
|
||||
|
||||
# Additional test cases can be added here
|
||||
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__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user