daren_project/test_config.py
2025-04-29 10:22:57 +08:00

76 lines
2.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
"""测试配置文件"""
# API配置
API_BASE_URL = "http://127.0.0.1:8000"
AUTH_TOKEN = "7831a86588bc08d025e4c9bd668de3b7940f7634"
# 请求头配置
HEADERS = {
"Authorization": f"Token {AUTH_TOKEN}",
"User-Agent": "Apifox/1.0.0 (https://apifox.com)",
"Content-Type": "application/json",
"Accept": "*/*",
"Host": "127.0.0.1:8000",
"Connection": "keep-alive",
"Cookie": "csrftoken=FIYybrNUqefEo2z9QyozmYqQhxTMSFPo; sessionid=ckvdyvy4vzsyfzxg7fie7xbhmxboqegv"
}
# 测试用例
TEST_CASES = [
{
"name": "基础总结测试",
"question": "总结下",
"conversation_id": "10b34248-2625-434b-a493-6d43520c837a",
"dataset_id": "8390ca43-6e63-4df9-b0b9-6cb20e1b38af",
"expected_response_time": 10.0
},
{
"name": "空内容测试",
"question": "",
"conversation_id": "10b34248-2625-434b-a493-6d43520c837a",
"dataset_id": "8390ca43-6e63-4df9-b0b9-6cb20e1b38af",
"expected_error": True
},
{
"name": "中文问答测试",
"question": "Python是什么",
"conversation_id": "10b34248-2625-434b-a493-6d43520c837a",
"dataset_id": "8390ca43-6e63-4df9-b0b9-6cb20e1b38af",
"expected_response_time": 10.0
}
]
# 日志配置
LOG_CONFIG = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S'
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'formatter': 'standard',
'class': 'logging.StreamHandler',
},
'file': {
'level': 'DEBUG',
'formatter': 'standard',
'class': 'logging.FileHandler',
'filename': 'stream_test.log',
'mode': 'w',
'encoding': 'utf-8',
}
},
'loggers': {
'stream_test': {
'handlers': ['console', 'file'],
'level': 'DEBUG',
'propagate': True
}
}
}