Skip to content

Commit

Permalink
Fix check door (ci-coverage)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskerPRC committed Sep 24, 2024
1 parent a8a3f78 commit ad55f16
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/test_all.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# tests/test_all.py

from infra_ai_service.api.common.utils import setup_qdrant_environment


Expand Down
41 changes: 41 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from fastapi.testclient import TestClient
import pytest
from infra_ai_service.core.app import get_app # 确保从你的应用文件导入 get_app

@pytest.fixture
def client():
app = get_app()
with TestClient(app) as client:
yield client

def test_text_processing_routes(client):
"""
测试文本处理路由。
"""
# 例:测试 /api/text/some_endpoint
response = client.get("/api/text/process")
assert response.status_code == 405

def test_embedding_routes(client):
"""
测试嵌入向量路由。
"""
# 例:测试 /api/embedding/some_endpoint
response = client.get("/api/embedding/embed")
assert response.status_code == 405

def test_vector_search_routes(client):
"""
测试向量搜索路由。
"""
# 例:测试 /api/search/some_endpoint
response = client.get("/api/search/query")
assert response.status_code == 405

def test_status_routes(client):
"""
测试状态路由。
"""
# 例:测试 /api/status/some_endpoint
response = client.get("/api/status/status")
assert response.status_code == 200

0 comments on commit ad55f16

Please sign in to comment.