mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-30 15:16:45 +08:00
Fix : Web API tests by normalizing errors, validation, and uploads (#12620)
### What problem does this PR solve? Fixes web API behavior mismatches that caused test failures by normalizing error responses, tightening validations, correcting error messages, and closing upload file handles. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -14,7 +14,8 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
from time import sleep
|
||||
|
||||
from ragflow_sdk import RAGFlow
|
||||
from configs import HOST_ADDRESS, VERSION
|
||||
import pytest
|
||||
from common import (
|
||||
batch_add_chunks,
|
||||
@ -81,7 +82,9 @@ def generate_test_files(request: FixtureRequest, tmp_path):
|
||||
def ragflow_tmp_dir(request, tmp_path_factory):
|
||||
class_name = request.cls.__name__
|
||||
return tmp_path_factory.mktemp(class_name)
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def client(token: str) -> RAGFlow:
|
||||
return RAGFlow(api_key=token, base_url=HOST_ADDRESS, version=VERSION)
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def WebApiAuth(auth):
|
||||
|
||||
Reference in New Issue
Block a user