mirror of https://github.com/THUDM/ChatGLM-6B
添加单元测试的注释
parent
d2aef0b8ad
commit
08acab3145
11
api_test.py
11
api_test.py
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue