Support saving history.
This commit is contained in:
+1
-5
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user