Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -6,11 +6,12 @@ from loguru import logger
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__))
|
||||
sys.path.insert(0, os.path.join(PROJECT_ROOT, "backend"))
|
||||
|
||||
from src.services.storage.milvus_client import MilvusClient, SearchResult
|
||||
from src.services.embedding.bge_m3_embedder import BGEM3Embedder
|
||||
from src.config.settings import settings
|
||||
from app.services.storage.milvus_client import MilvusClient, SearchResult
|
||||
from app.services.embedding.bge_m3_embedder import BGEM3Embedder
|
||||
from app.config.settings import settings
|
||||
|
||||
|
||||
class TestMilvusConnection:
|
||||
@@ -55,7 +56,7 @@ class TestMilvusOperations:
|
||||
|
||||
def test_insert_and_search(self, client):
|
||||
"""测试插入和检索"""
|
||||
from src.services.embedding.text_chunker import TextChunk, ChunkMetadata
|
||||
from app.services.embedding.text_chunker import TextChunk, ChunkMetadata
|
||||
|
||||
# 创建测试数据
|
||||
chunks = [
|
||||
@@ -133,4 +134,4 @@ class TestEmbedding:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main([__file__, "-v"])
|
||||
pytest.main([__file__, "-v"])
|
||||
|
||||
Reference in New Issue
Block a user