(self)
| 60 | return web, client |
| 61 | |
| 62 | def test_chat(self): |
| 63 | from examples.chatbot import chat |
| 64 | chat.start() |
| 65 | query = '请原样英文输出:Hello world.' |
| 66 | res = chat(query) |
| 67 | assert res == 'Hello world.' |
| 68 | |
| 69 | # test chat warpped in web |
| 70 | _, client = self.warp_into_web(chat) |
| 71 | chat_history = [[query, None]] |
| 72 | ans = client.predict(self.use_context, |
| 73 | chat_history, |
| 74 | self.stream_output, |
| 75 | self.append_text, |
| 76 | api_name='/_respond_stream') |
| 77 | assert ans[0][-1][-1] == 'Hello world.' |
| 78 | |
| 79 | def test_story(self): |
| 80 | from examples.story import ppl |
nothing calls this directly
no test coverage detected