- 实现SearchConfigTab.vue组件,用于管理搜索配置设置 - 增加加载状态、错误处理和默认重置功能 - 集成本地存储功能,支持用户配置的保存与加载 - 更新AppLayout.vue,在数据库信息视图中新增SearchConfigTab - 修改数据库存储逻辑,支持必要时跳过查询参数加载 - 增强DataBaseInfoView.vue,为向量数据库添加重排序器配置选项 - 重构database.js,优化查询参数加载逻辑 - 清理未使用导入项并优化各组件样式
29 lines
860 B
Python
29 lines
860 B
Python
"""
|
|
Integration tests for settings router endpoints.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
pytestmark = [pytest.mark.asyncio, pytest.mark.integration]
|
|
|
|
|
|
async def test_reranker_list_requires_admin(test_client, standard_user):
|
|
public_response = await test_client.get("/api/settings/rerankers")
|
|
assert public_response.status_code == 401
|
|
|
|
forbidden_response = await test_client.get(
|
|
"/api/settings/rerankers", headers=standard_user["headers"]
|
|
)
|
|
assert forbidden_response.status_code == 403
|
|
|
|
|
|
async def test_admin_can_list_rerankers(test_client, admin_headers):
|
|
response = await test_client.get("/api/settings/rerankers", headers=admin_headers)
|
|
assert response.status_code == 200, response.text
|
|
payload = response.json()
|
|
|
|
assert "rerankers" in payload
|
|
assert isinstance(payload["rerankers"], dict)
|