This commit is contained in:
gongwenxin
2025-05-19 17:35:50 +08:00
parent 61b7befb1f
commit 4a22060890
4 changed files with 10053 additions and 10202 deletions
@@ -14,10 +14,6 @@ import datetime
from .input_parser.parser import InputParser, YAPIEndpoint, SwaggerEndpoint, ParsedYAPISpec, ParsedSwaggerSpec
from .api_caller.caller import APICaller, APIRequest, APIResponse
from .json_schema_validator.validator import JSONSchemaValidator
from .rule_repository.repository import RuleRepository
from .rule_executor.executor import RuleExecutor
from .models.rule_models import RuleQuery, TargetType, RuleCategory, RuleLifecycle, RuleScope
from .models.config_models import RuleRepositoryConfig, RuleStorageConfig
from .test_framework_core import ValidationResult, TestSeverity, APIRequestContext, APIResponseContext, BaseAPITestCase
from .test_case_registry import TestCaseRegistry
@@ -302,7 +298,6 @@ class APITestOrchestrator:
"""API测试编排器"""
def __init__(self, base_url: str,
rule_repo_path: str = "./rules", # 旧规则引擎的规则库路径
custom_test_cases_dir: Optional[str] = None # 新的自定义测试用例目录路径
):
"""
@@ -310,7 +305,6 @@ class APITestOrchestrator:
Args:
base_url: API基础URL
rule_repo_path: (旧)规则库路径
custom_test_cases_dir: 存放自定义 APITestCase 的目录路径。如果为 None,则不加载自定义测试用例。
"""
self.base_url = base_url.rstrip('/')
@@ -321,14 +315,6 @@ class APITestOrchestrator:
self.api_caller = APICaller()
self.validator = JSONSchemaValidator() # JSON Schema 验证器,可能会被测试用例内部使用
# 初始化 (旧) 规则库和规则执行器
# 未来可以考虑是否完全移除或将其功能也通过 APITestCase 实现
rule_config = RuleRepositoryConfig(
storage=RuleStorageConfig(path=rule_repo_path)
)
self.rule_repo = RuleRepository(rule_config)
self.rule_executor = RuleExecutor(self.rule_repo)
# 初始化 (新) 测试用例注册表
self.test_case_registry: Optional[TestCaseRegistry] = None
if custom_test_cases_dir: