mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Add tests for frontend API (#3552)
### What problem does this PR solve? Add tests for frontend API ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
2
sdk/python/test/test_frontend_api/common.py
Normal file
2
sdk/python/test/test_frontend_api/common.py
Normal file
@ -0,0 +1,2 @@
|
||||
import os
|
||||
HOST_ADDRESS=os.getenv('HOST_ADDRESS', 'http://127.0.0.1:9380')
|
||||
3
sdk/python/test/test_frontend_api/get_email.py
Normal file
3
sdk/python/test/test_frontend_api/get_email.py
Normal file
@ -0,0 +1,3 @@
|
||||
def test_get_email(get_email):
|
||||
print(f"\nEmail account:",flush=True)
|
||||
print(f"{get_email}\n",flush=True)
|
||||
10
sdk/python/test/test_frontend_api/test_dataset.py
Normal file
10
sdk/python/test/test_frontend_api/test_dataset.py
Normal file
@ -0,0 +1,10 @@
|
||||
from common import HOST_ADDRESS
|
||||
import requests
|
||||
def test_create_dataset(get_auth):
|
||||
authorization={"Authorization": get_auth}
|
||||
url = f"{HOST_ADDRESS}/v1/kb/create"
|
||||
json = {"name":"test_create_dataset"}
|
||||
res = requests.post(url=url,headers=authorization,json=json)
|
||||
res = res.json()
|
||||
assert res.get("code") == 0,f"{res.get('message')}"
|
||||
|
||||
Reference in New Issue
Block a user