fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解
This commit is contained in:
@@ -20,7 +20,6 @@ from search_manager import (
|
||||
# 添加 backend 到路径
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
def test_fulltext_search():
|
||||
"""测试全文搜索"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -66,7 +65,6 @@ def test_fulltext_search():
|
||||
print("\n✓ 全文搜索测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_semantic_search():
|
||||
"""测试语义搜索"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -102,7 +100,6 @@ def test_semantic_search():
|
||||
print("\n✓ 语义搜索测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_entity_path_discovery():
|
||||
"""测试实体路径发现"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -121,7 +118,6 @@ def test_entity_path_discovery():
|
||||
print("\n✓ 实体路径发现测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_knowledge_gap_detection():
|
||||
"""测试知识缺口识别"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -140,7 +136,6 @@ def test_knowledge_gap_detection():
|
||||
print("\n✓ 知识缺口识别测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_cache_manager():
|
||||
"""测试缓存管理器"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -190,7 +185,6 @@ def test_cache_manager():
|
||||
print("\n✓ 缓存管理器测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_task_queue():
|
||||
"""测试任务队列"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -232,7 +226,6 @@ def test_task_queue():
|
||||
print("\n✓ 任务队列测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_performance_monitor():
|
||||
"""测试性能监控"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -277,7 +270,6 @@ def test_performance_monitor():
|
||||
print("\n✓ 性能监控测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_search_manager():
|
||||
"""测试搜索管理器"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -298,7 +290,6 @@ def test_search_manager():
|
||||
print("\n✓ 搜索管理器测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def test_performance_manager():
|
||||
"""测试性能管理器"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -323,7 +314,6 @@ def test_performance_manager():
|
||||
print("\n✓ 性能管理器测试完成")
|
||||
return True
|
||||
|
||||
|
||||
def run_all_tests():
|
||||
"""运行所有测试"""
|
||||
print("\n" + "=" * 60)
|
||||
@@ -410,7 +400,6 @@ def run_all_tests():
|
||||
|
||||
return passed == total
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
success = run_all_tests()
|
||||
sys.exit(0 if success else 1)
|
||||
|
||||
Reference in New Issue
Block a user