Refa: Test configs (#8220)

### What problem does this PR solve?

- Move common constants (HOST_ADDRESS, INVALID_API_TOKEN, etc.) to
configs.py
- Update test imports to use centralized configs
- Clean up duplicate constant definitions across test files

This improves maintainability by centralizing configuration.

### Type of change

- [x] Refactoring test case
This commit is contained in:
Liu An
2025-06-12 17:42:00 +08:00
committed by GitHub
parent 54a465f9e8
commit 86a1411b07
23 changed files with 44 additions and 33 deletions

View File

@ -15,7 +15,8 @@
#
import pytest
from common import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN, create_chat_assistant
from common import create_chat_assistant
from configs import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN
from libs.auth import RAGFlowHttpApiAuth
from utils import encode_avatar
from utils.file_utils import create_image_file

View File

@ -16,7 +16,8 @@
from concurrent.futures import ThreadPoolExecutor, as_completed
import pytest
from common import INVALID_API_TOKEN, batch_create_chat_assistants, delete_chat_assistants, list_chat_assistants
from common import batch_create_chat_assistants, delete_chat_assistants, list_chat_assistants
from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowHttpApiAuth

View File

@ -16,7 +16,8 @@
from concurrent.futures import ThreadPoolExecutor, as_completed
import pytest
from common import INVALID_API_TOKEN, delete_datasets, list_chat_assistants
from common import delete_datasets, list_chat_assistants
from configs import INVALID_API_TOKEN
from libs.auth import RAGFlowHttpApiAuth
from utils import is_sorted

View File

@ -14,7 +14,8 @@
# limitations under the License.
#
import pytest
from common import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN, list_chat_assistants, update_chat_assistant
from common import list_chat_assistants, update_chat_assistant
from configs import CHAT_ASSISTANT_NAME_LIMIT, INVALID_API_TOKEN
from libs.auth import RAGFlowHttpApiAuth
from utils import encode_avatar
from utils.file_utils import create_image_file