Support saving history.

This commit is contained in:
OK
2023-03-24 18:27:30 +01:00
parent 6d2a3d6ac5
commit b82477fc83
2 changed files with 19 additions and 9 deletions
+1 -5
View File
@@ -111,12 +111,8 @@ class TestFunctionality(TestBotBase):
async def test_on_message_event3(self) -> None:
async def acreate(*a, **kw):
return {'choices': [{'message': {'content': '{ "test": 3 ]'}}]}
def logging_warning(msg):
raise RuntimeError(msg)
message = self.create_message("Hello there! How are you?")
with patch.object(openai.ChatCompletion, 'acreate', new=acreate), \
patch.object(logging, 'warning', logging_warning):
with patch.object(openai.ChatCompletion, 'acreate', new=acreate):
await self.bot.on_message(message)
self.bot.staff_channel.send.assert_called_once_with("ERROR: I could not parse this answer: '{ \"test\": 3 ]'", suppress_embeds=True)