mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
Feat: add new tests and tescases for restful api suite (#15347)
### What problem does this PR solve? extend restful api suite ### Type of change - [x] New Feature (non-breaking change which adds functionality) - [x] Other (please describe): test
This commit is contained in:
@@ -16,8 +16,7 @@
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import pytest
|
||||
import requests
|
||||
from test.testcases.configs import HOST_ADDRESS, INVALID_API_TOKEN, VERSION
|
||||
from test.testcases.configs import INVALID_API_TOKEN
|
||||
from test.testcases.restful_api.helpers.client import RestClient
|
||||
from test.testcases.utils import wait_for
|
||||
|
||||
@@ -378,12 +377,8 @@ def test_deleted_chunks_batch_not_in_retrieval_contract(rest_client, create_docu
|
||||
|
||||
|
||||
@pytest.mark.p2
|
||||
def test_related_questions_contract(auth, rest_client, rest_client_noauth):
|
||||
tokens_res = requests.get(
|
||||
f"{HOST_ADDRESS}/api/{VERSION}/system/tokens",
|
||||
headers={"Authorization": auth},
|
||||
timeout=30,
|
||||
)
|
||||
def test_related_questions_contract(rest_client, rest_client_noauth):
|
||||
tokens_res = rest_client.get("/system/tokens")
|
||||
assert tokens_res.status_code == 200, tokens_res.text
|
||||
tokens_payload = tokens_res.json()
|
||||
assert tokens_payload["code"] == 0, tokens_payload
|
||||
|
||||
Reference in New Issue
Block a user