添加单元测试的注释

pull/547/head
Whitroom 2023-04-12 16:08:21 +08:00
parent d2aef0b8ad
commit 08acab3145
1 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,17 @@ import unittest
from httpx import AsyncClient from httpx import AsyncClient
class TestGenerateChat(unittest.IsolatedAsyncioTestCase): class TestGenerateChat(unittest.IsolatedAsyncioTestCase):
"""
测试生成聊天内容
1. 先启动服务
```bash
python api.py
```
2. 运行测试
```bash
python -m unittest api_test.py
```
"""
async def test_generate_chat(self): async def test_generate_chat(self):
async with AsyncClient() as ac: async with AsyncClient() as ac:
response = await ac.post( response = await ac.post(