完成部分API路由以及文档
This commit is contained in:
15
test_main.py
Normal file
15
test_main.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
|
||||
def test_read_main():
|
||||
from pkg.conf.appmeta import BackendVersion
|
||||
response = client.get("/api/site/ping")
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {
|
||||
"code": 0,
|
||||
'data': BackendVersion,
|
||||
'msg': None}
|
||||
Reference in New Issue
Block a user