diff --git a/__pycache__/run_tests.cpython-312.pyc b/__pycache__/run_tests.cpython-312.pyc new file mode 100644 index 0000000..d25e049 Binary files /dev/null and b/__pycache__/run_tests.cpython-312.pyc differ diff --git a/ddms_compliance_suite/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..49a5ea2 Binary files /dev/null and b/ddms_compliance_suite/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/__pycache__/api_test_cli.cpython-312.pyc b/ddms_compliance_suite/__pycache__/api_test_cli.cpython-312.pyc new file mode 100644 index 0000000..c69880e Binary files /dev/null and b/ddms_compliance_suite/__pycache__/api_test_cli.cpython-312.pyc differ diff --git a/ddms_compliance_suite/__pycache__/api_test_generator.cpython-312.pyc b/ddms_compliance_suite/__pycache__/api_test_generator.cpython-312.pyc new file mode 100644 index 0000000..688fbd2 Binary files /dev/null and b/ddms_compliance_suite/__pycache__/api_test_generator.cpython-312.pyc differ diff --git a/ddms_compliance_suite/__pycache__/test_case_registry.cpython-312.pyc b/ddms_compliance_suite/__pycache__/test_case_registry.cpython-312.pyc new file mode 100644 index 0000000..e8196b4 Binary files /dev/null and b/ddms_compliance_suite/__pycache__/test_case_registry.cpython-312.pyc differ diff --git a/ddms_compliance_suite/__pycache__/test_framework_core.cpython-312.pyc b/ddms_compliance_suite/__pycache__/test_framework_core.cpython-312.pyc new file mode 100644 index 0000000..4f91021 Binary files /dev/null and b/ddms_compliance_suite/__pycache__/test_framework_core.cpython-312.pyc differ diff --git a/ddms_compliance_suite/__pycache__/test_orchestrator.cpython-312.pyc b/ddms_compliance_suite/__pycache__/test_orchestrator.cpython-312.pyc new file mode 100644 index 0000000..6e434c3 Binary files /dev/null and b/ddms_compliance_suite/__pycache__/test_orchestrator.cpython-312.pyc differ diff --git a/ddms_compliance_suite/api_caller/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/api_caller/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..2bcb803 Binary files /dev/null and b/ddms_compliance_suite/api_caller/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/api_caller/__pycache__/caller.cpython-312.pyc b/ddms_compliance_suite/api_caller/__pycache__/caller.cpython-312.pyc new file mode 100644 index 0000000..8def1a9 Binary files /dev/null and b/ddms_compliance_suite/api_caller/__pycache__/caller.cpython-312.pyc differ diff --git a/ddms_compliance_suite/case_generator/__pycache__/generator.cpython-312.pyc b/ddms_compliance_suite/case_generator/__pycache__/generator.cpython-312.pyc new file mode 100644 index 0000000..6750cf7 Binary files /dev/null and b/ddms_compliance_suite/case_generator/__pycache__/generator.cpython-312.pyc differ diff --git a/ddms_compliance_suite/input_parser/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/input_parser/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..670b624 Binary files /dev/null and b/ddms_compliance_suite/input_parser/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/input_parser/__pycache__/parser.cpython-312.pyc b/ddms_compliance_suite/input_parser/__pycache__/parser.cpython-312.pyc new file mode 100644 index 0000000..90971a8 Binary files /dev/null and b/ddms_compliance_suite/input_parser/__pycache__/parser.cpython-312.pyc differ diff --git a/ddms_compliance_suite/json_schema_validator/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/json_schema_validator/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..2f46ad4 Binary files /dev/null and b/ddms_compliance_suite/json_schema_validator/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/json_schema_validator/__pycache__/validator.cpython-312.pyc b/ddms_compliance_suite/json_schema_validator/__pycache__/validator.cpython-312.pyc new file mode 100644 index 0000000..0987378 Binary files /dev/null and b/ddms_compliance_suite/json_schema_validator/__pycache__/validator.cpython-312.pyc differ diff --git a/ddms_compliance_suite/models/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..4de177b Binary files /dev/null and b/ddms_compliance_suite/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/models/__pycache__/config_models.cpython-312.pyc b/ddms_compliance_suite/models/__pycache__/config_models.cpython-312.pyc new file mode 100644 index 0000000..9da7cc9 Binary files /dev/null and b/ddms_compliance_suite/models/__pycache__/config_models.cpython-312.pyc differ diff --git a/ddms_compliance_suite/models/__pycache__/rule_models.cpython-312.pyc b/ddms_compliance_suite/models/__pycache__/rule_models.cpython-312.pyc new file mode 100644 index 0000000..f9f32ab Binary files /dev/null and b/ddms_compliance_suite/models/__pycache__/rule_models.cpython-312.pyc differ diff --git a/ddms_compliance_suite/models/__pycache__/test_models.cpython-312.pyc b/ddms_compliance_suite/models/__pycache__/test_models.cpython-312.pyc new file mode 100644 index 0000000..86e3d00 Binary files /dev/null and b/ddms_compliance_suite/models/__pycache__/test_models.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_executor/__pycache__/executor.cpython-312.pyc b/ddms_compliance_suite/rule_executor/__pycache__/executor.cpython-312.pyc new file mode 100644 index 0000000..398d228 Binary files /dev/null and b/ddms_compliance_suite/rule_executor/__pycache__/executor.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/rule_repository/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..6cd4772 Binary files /dev/null and b/ddms_compliance_suite/rule_repository/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/__pycache__/python_executor.cpython-312.pyc b/ddms_compliance_suite/rule_repository/__pycache__/python_executor.cpython-312.pyc new file mode 100644 index 0000000..e6adc1d Binary files /dev/null and b/ddms_compliance_suite/rule_repository/__pycache__/python_executor.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/__pycache__/repository.cpython-312.pyc b/ddms_compliance_suite/rule_repository/__pycache__/repository.cpython-312.pyc new file mode 100644 index 0000000..4a49dc4 Binary files /dev/null and b/ddms_compliance_suite/rule_repository/__pycache__/repository.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/__pycache__/yaml_adapter.cpython-312.pyc b/ddms_compliance_suite/rule_repository/__pycache__/yaml_adapter.cpython-312.pyc new file mode 100644 index 0000000..b8b4a11 Binary files /dev/null and b/ddms_compliance_suite/rule_repository/__pycache__/yaml_adapter.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/adapters/__pycache__/__init__.cpython-312.pyc b/ddms_compliance_suite/rule_repository/adapters/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..9a5445e Binary files /dev/null and b/ddms_compliance_suite/rule_repository/adapters/__pycache__/__init__.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/adapters/__pycache__/base_adapter.cpython-312.pyc b/ddms_compliance_suite/rule_repository/adapters/__pycache__/base_adapter.cpython-312.pyc new file mode 100644 index 0000000..becf7b8 Binary files /dev/null and b/ddms_compliance_suite/rule_repository/adapters/__pycache__/base_adapter.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/adapters/__pycache__/filesystem_adapter.cpython-312.pyc b/ddms_compliance_suite/rule_repository/adapters/__pycache__/filesystem_adapter.cpython-312.pyc new file mode 100644 index 0000000..4b99c4d Binary files /dev/null and b/ddms_compliance_suite/rule_repository/adapters/__pycache__/filesystem_adapter.cpython-312.pyc differ diff --git a/ddms_compliance_suite/rule_repository/adapters/__pycache__/rule_adapter_utils.cpython-312.pyc b/ddms_compliance_suite/rule_repository/adapters/__pycache__/rule_adapter_utils.cpython-312.pyc new file mode 100644 index 0000000..1439538 Binary files /dev/null and b/ddms_compliance_suite/rule_repository/adapters/__pycache__/rule_adapter_utils.cpython-312.pyc differ diff --git a/ddms_compliance_suite/test_case_registry.py b/ddms_compliance_suite/test_case_registry.py new file mode 100644 index 0000000..d3cb074 --- /dev/null +++ b/ddms_compliance_suite/test_case_registry.py @@ -0,0 +1,210 @@ +import os +import importlib.util +import inspect +import logging +import re +from typing import List, Type, Optional, Dict + +# 确保可以从 sibling 模块导入 +from .test_framework_core import BaseAPITestCase + +class TestCaseRegistry: + """ + 负责发现、加载和管理所有自定义的APITestCase类。 + """ + def __init__(self, test_cases_dir: str): + """ + 初始化 TestCaseRegistry。 + Args: + test_cases_dir: 存放自定义测试用例 (.py 文件) 的目录路径。 + """ + self.test_cases_dir = test_cases_dir + self.logger = logging.getLogger(__name__) + self._registry: Dict[str, Type[BaseAPITestCase]] = {} + self._test_case_classes: List[Type[BaseAPITestCase]] = [] + self.discover_test_cases() + + def discover_test_cases(self): + """ + 扫描指定目录,动态导入模块,并注册所有继承自 BaseAPITestCase 的类。 + """ + if not os.path.isdir(self.test_cases_dir): + self.logger.warning(f"测试用例目录不存在或不是一个目录: {self.test_cases_dir}") + return + + self.logger.info(f"开始从目录 '{self.test_cases_dir}' 发现测试用例...") + found_count = 0 + for filename in os.listdir(self.test_cases_dir): + if filename.endswith(".py") and not filename.startswith("__"): + module_name = filename[:-3] + file_path = os.path.join(self.test_cases_dir, filename) + try: + # 动态导入模块 + spec = importlib.util.spec_from_file_location(module_name, file_path) + if spec and spec.loader: + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + self.logger.debug(f"成功导入模块: {module_name} 从 {file_path}") + + # 在模块中查找 BaseAPITestCase 的子类 + for name, obj in inspect.getmembers(module): + if inspect.isclass(obj) and issubclass(obj, BaseAPITestCase) and obj is not BaseAPITestCase: + if obj.id in self._registry: + self.logger.warning(f"发现重复的测试用例 ID: '{obj.id}' (来自类 '{obj.__name__}' in {file_path})。之前的定义将被覆盖。") + + self._registry[obj.id] = obj + if obj not in self._test_case_classes: # 避免重复添加同一个类对象 + self._test_case_classes.append(obj) + found_count += 1 + self.logger.info(f"已注册测试用例: '{obj.id}' ({obj.name}) 来自类 '{obj.__name__}'") + else: + self.logger.error(f"无法为文件 '{file_path}' 创建模块规范。") + except ImportError as e: + self.logger.error(f"导入模块 '{module_name}' 从 '{file_path}' 失败: {e}", exc_info=True) + except AttributeError as e: + self.logger.error(f"在模块 '{module_name}' ({file_path}) 中查找测试用例时出错 (可能是缺少必要的元数据如 'id'): {e}", exc_info=True) + except Exception as e: + self.logger.error(f"处理文件 '{file_path}' 时发生未知错误: {e}", exc_info=True) + + self.logger.info(f"测试用例发现完成。总共注册了 {len(self._registry)} 个独特的测试用例 (基于ID)。发现 {found_count} 个测试用例类。") + + def get_test_case_by_id(self, case_id: str) -> Optional[Type[BaseAPITestCase]]: + """根据ID获取已注册的测试用例类。""" + return self._registry.get(case_id) + + def get_all_test_case_classes(self) -> List[Type[BaseAPITestCase]]: + """获取所有已注册的测试用例类列表。""" + return list(self._test_case_classes) # 返回副本 + + def get_applicable_test_cases(self, endpoint_method: str, endpoint_path: str) -> List[Type[BaseAPITestCase]]: + """ + 根据API端点的方法和路径,筛选出适用的测试用例类。 + + Args: + endpoint_method: API端点的方法 (例如 "GET", "POST")。 + endpoint_path: API端点的路径 (例如 "/users/{id}")。 + + Returns: + 一个包含适用测试用例类的列表。 + """ + applicable_cases: List[Type[BaseAPITestCase]] = [] + for tc_class in self._test_case_classes: + # 1. 检查 applicable_methods + if tc_class.applicable_methods is not None: + if endpoint_method.upper() not in [m.upper() for m in tc_class.applicable_methods]: + self.logger.debug(f"测试用例 '{tc_class.id}' 不适用于方法 '{endpoint_method}' (期望: {tc_class.applicable_methods}),已跳过。") + continue # 方法不匹配,跳过此测试用例 + + # 2. 检查 applicable_paths_regex + if tc_class.applicable_paths_regex is not None: + try: + if not re.match(tc_class.applicable_paths_regex, endpoint_path): + self.logger.debug(f"测试用例 '{tc_class.id}' 不适用于路径 '{endpoint_path}' (正则: '{tc_class.applicable_paths_regex}'),已跳过。") + continue # 路径正则不匹配,跳过此测试用例 + except re.error as e: + self.logger.error(f"测试用例 '{tc_class.id}' 中的路径正则表达式 '{tc_class.applicable_paths_regex}' 无效: {e}。此测试用例将不匹配任何路径。") + continue + + # 如果通过了所有检查,则认为适用 + applicable_cases.append(tc_class) + self.logger.debug(f"测试用例 '{tc_class.id}' 适用于端点 '{endpoint_method} {endpoint_path}'。") + + return applicable_cases + +# 示例用法 (用于测试此模块,实际使用时由编排器调用) +if __name__ == '__main__': + logging.basicConfig(level=logging.DEBUG) + logger = logging.getLogger(__name__) + + # 假设项目结构如下: + # your_project_root/ + # ddms_compliance_suite/ + # test_framework_core.py + # test_case_registry.py + # custom_testcases/ <-- 测试用例存放目录 + # example_checks.py + # another_set_of_checks.py + + # 创建一个临时的 custom_testcases 目录和一些示例测试用例文件用于测试 + current_dir = os.path.dirname(os.path.abspath(__file__)) + custom_testcases_path = os.path.join(os.path.dirname(current_dir), "custom_testcases") # 假设custom_testcases在ddms_compliance_suite的父目录 + + if not os.path.exists(custom_testcases_path): + os.makedirs(custom_testcases_path) + logger.info(f"创建临时目录: {custom_testcases_path}") + + # 示例测试用例文件1: example_checks.py + example_checks_content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity + +class MyFirstTest(BaseAPITestCase): + id = "TC-EXAMPLE-001" + name = "我的第一个测试" + description = "一个简单的示例测试。" + severity = TestSeverity.INFO + tags = ["example"] + applicable_methods = ["GET"] + +class MySecondTest(BaseAPITestCase): + id = "TC-EXAMPLE-002" + name = "我的第二个测试" + description = "另一个示例测试,适用于所有方法和特定路径。" + severity = TestSeverity.MEDIUM + tags = ["example", "path_specific"] + applicable_paths_regex = r"/api/users/.+" +""" + with open(os.path.join(custom_testcases_path, "example_checks.py"), "w", encoding="utf-8") as f: + f.write(example_checks_content) + logger.info(f"创建示例测试文件: {os.path.join(custom_testcases_path, 'example_checks.py')}") + + # 示例测试用例文件2: specific_feature_tests.py (无适用性限制) + specific_tests_content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity + +class FeatureXCheck(BaseAPITestCase): + id = "TC-FEATUREX-001" + name = "特性X的检查" + description = "验证特性X的相关功能。" + severity = TestSeverity.HIGH + tags = ["feature-x"] +""" + with open(os.path.join(custom_testcases_path, "specific_feature_tests.py"), "w", encoding="utf-8") as f: + f.write(specific_tests_content) + logger.info(f"创建示例测试文件: {os.path.join(custom_testcases_path, 'specific_feature_tests.py')}") + + # 测试 TestCaseRegistry + registry = TestCaseRegistry(test_cases_dir=custom_testcases_path) + + logger.info("\n--- 所有已注册的测试用例类 ---") + all_cases = registry.get_all_test_case_classes() + for tc_class in all_cases: + logger.info(f" ID: {tc_class.id}, Name: {tc_class.name}, Methods: {tc_class.applicable_methods}, Path Regex: {tc_class.applicable_paths_regex}") + + logger.info("\n--- 测试适用性筛选 ---") + endpoint1_method = "GET" + endpoint1_path = "/api/users/123" + logger.info(f"筛选适用于 '{endpoint1_method} {endpoint1_path}':") + applicable1 = registry.get_applicable_test_cases(endpoint1_method, endpoint1_path) + for tc_class in applicable1: + logger.info(f" Applicable: {tc_class.id} ({tc_class.name})") + + endpoint2_method = "POST" + endpoint2_path = "/api/orders" + logger.info(f"筛选适用于 '{endpoint2_method} {endpoint2_path}':") + applicable2 = registry.get_applicable_test_cases(endpoint2_method, endpoint2_path) + for tc_class in applicable2: + logger.info(f" Applicable: {tc_class.id} ({tc_class.name})") + + endpoint3_method = "GET" + endpoint3_path = "/api/health" + logger.info(f"筛选适用于 '{endpoint3_method} {endpoint3_path}':") + applicable3 = registry.get_applicable_test_cases(endpoint3_method, endpoint3_path) + for tc_class in applicable3: + logger.info(f" Applicable: {tc_class.id} ({tc_class.name})") + + # 清理临时文件和目录 + # os.remove(os.path.join(custom_testcases_path, "example_checks.py")) + # os.remove(os.path.join(custom_testcases_path, "specific_feature_tests.py")) + # if not os.listdir(custom_testcases_path): + # os.rmdir(custom_testcases_path) + # logger.info("已清理临时文件和目录。") \ No newline at end of file diff --git a/ddms_compliance_suite/test_framework_core.py b/ddms_compliance_suite/test_framework_core.py new file mode 100644 index 0000000..e4413ba --- /dev/null +++ b/ddms_compliance_suite/test_framework_core.py @@ -0,0 +1,143 @@ +from enum import Enum +from typing import Any, Dict, Optional, List, Tuple, Type +import logging + +class TestSeverity(Enum): + """测试用例的严重程度""" + CRITICAL = "严重" + HIGH = "高" + MEDIUM = "中" + LOW = "低" + INFO = "信息" + +class ValidationResult: + """封装单个验证点的结果""" + def __init__(self, passed: bool, message: str, details: Optional[Dict[str, Any]] = None): + self.passed = passed # True 表示通过, False 表示失败 + self.message = message # 验证结果的描述信息 + self.details = details or {} # 其他详细信息,如实际值、期望值等 + + def __repr__(self): + return f"ValidationResult(passed={self.passed}, message='{self.message}')" + +class APIRequestContext: + """封装当前API请求的上下文信息""" + def __init__(self, + method: str, + url: str, + path_params: Dict[str, Any], + query_params: Dict[str, Any], + headers: Dict[str, str], + body: Optional[Any], + endpoint_spec: Dict[str, Any] # 添加 endpoint_spec 到请求上下文 + ): + self.method = method + self.url = url + self.path_params = path_params + self.query_params = query_params + self.headers = headers + self.body = body + self.endpoint_spec = endpoint_spec # 当前测试端点的API规范部分 + + def __repr__(self): + return (f"APIRequestContext(method='{self.method}', url='{self.url}', " + f"query_params={self.query_params}, headers_keys={list(self.headers.keys())}, " + f"has_body={self.body is not None})") + +class APIResponseContext: + """封装当前API响应的上下文信息""" + def __init__(self, + status_code: int, + headers: Dict[str, str], + json_content: Optional[Any], + text_content: Optional[str], + elapsed_time: float, + original_response: Any, # 例如 requests.Response 对象 + request_context: APIRequestContext # 对应的请求上下文 + ): + self.status_code = status_code + self.headers = headers + self.json_content = json_content + self.text_content = text_content + self.elapsed_time = elapsed_time + self.original_response = original_response + self.request_context = request_context # 包含触发此响应的请求信息 + + def __repr__(self): + return (f"APIResponseContext(status_code={self.status_code}, " + f"headers_keys={list(self.headers.keys())}, has_json={self.json_content is not None}, " + f"elapsed_time={self.elapsed_time:.4f}s)") + + +class BaseAPITestCase: + """ + 自定义API测试用例的基类。 + 用户应继承此类来创建具体的测试用例。 + """ + # --- 元数据 (由子类定义) --- + id: str = "base_test_case" + name: str = "基础API测试用例" + description: str = "这是一个基础测试用例,应由具体测试用例继承。" + severity: TestSeverity = TestSeverity.MEDIUM + tags: List[str] = [] + + applicable_methods: Optional[List[str]] = None + applicable_paths_regex: Optional[str] = None + + def __init__(self, endpoint_spec: Dict[str, Any], global_api_spec: Dict[str, Any]): + """ + 初始化测试用例。 + Args: + endpoint_spec: 当前被测API端点的详细定义 (来自YAPI/Swagger解析结果)。 + global_api_spec: 完整的API规范文档 (来自YAPI/Swagger解析结果)。 + """ + self.endpoint_spec = endpoint_spec + self.global_api_spec = global_api_spec + self.logger = logging.getLogger(f"testcase.{self.id}") + self.logger.debug(f"Test case '{self.id}' initialized for endpoint: {self.endpoint_spec.get('method', '')} {self.endpoint_spec.get('path', '')}") + + # --- 1. 请求生成与修改阶段 --- + def generate_query_params(self, current_query_params: Dict[str, Any]) -> Dict[str, Any]: + self.logger.debug(f"Hook: generate_query_params, current: {current_query_params}") + return current_query_params + + def generate_headers(self, current_headers: Dict[str, str]) -> Dict[str, str]: + self.logger.debug(f"Hook: generate_headers, current keys: {list(current_headers.keys())}") + return current_headers + + def generate_request_body(self, current_body: Optional[Any]) -> Optional[Any]: + self.logger.debug(f"Hook: generate_request_body, current body type: {type(current_body)}") + return current_body + + # --- 2. 请求预校验阶段 --- + def validate_request_url(self, url: str, request_context: APIRequestContext) -> List[ValidationResult]: + self.logger.debug(f"Hook: validate_request_url, url: {url}") + return [] + + def validate_request_headers(self, headers: Dict[str, str], request_context: APIRequestContext) -> List[ValidationResult]: + self.logger.debug(f"Hook: validate_request_headers, header keys: {list(headers.keys())}") + return [] + + def validate_request_body(self, body: Optional[Any], request_context: APIRequestContext) -> List[ValidationResult]: + self.logger.debug(f"Hook: validate_request_body, body type: {type(body)}") + return [] + + # --- 3. 响应验证阶段 --- + def validate_response(self, response_context: APIResponseContext, request_context: APIRequestContext) -> List[ValidationResult]: + self.logger.debug(f"Hook: validate_response, status: {response_context.status_code}") + return [] + + # --- 4. 性能与附加检查阶段 (可选) --- + def check_performance(self, response_context: APIResponseContext, request_context: APIRequestContext) -> List[ValidationResult]: + self.logger.debug(f"Hook: check_performance, elapsed: {response_context.elapsed_time}") + return [] + + # --- Helper to easily create a passed ValidationResult --- + @staticmethod + def passed(message: str, details: Optional[Dict[str, Any]] = None) -> ValidationResult: + return ValidationResult(passed=True, message=message, details=details) + + # --- Helper to easily create a failed ValidationResult --- + @staticmethod + def failed(message: str, details: Optional[Dict[str, Any]] = None) -> ValidationResult: + return ValidationResult(passed=False, message=message, details=details) \ No newline at end of file diff --git a/docs/APITestCase_Development_Guide.md b/docs/APITestCase_Development_Guide.md new file mode 100644 index 0000000..081d8f2 --- /dev/null +++ b/docs/APITestCase_Development_Guide.md @@ -0,0 +1,330 @@ +# APITestCase 开发指南 + +本文档旨在指导开发人员如何创建和使用自定义的 `APITestCase` 类,以扩展 DDMS 合规性验证软件的测试能力。通过继承 `BaseAPITestCase`,您可以编写灵活且强大的 Python 代码来定义针对 API 的各种验证逻辑。 + +## 1. `APITestCase` 概述 + +`APITestCase` 是 DDMS 合规性验证软件中定义具体测试逻辑的核心单元。每个派生自 `BaseAPITestCase` 的类代表一个独立的测试场景或一组相关的检查点,例如验证特定的请求头、检查响应状态码、或确保响应体符合特定业务规则。 + +**核心理念:** + +* **代码即测试**:使用 Python 的全部功能来定义复杂的测试逻辑,摆脱传统基于配置或简单规则的限制。 +* **灵活性**:允许测试用例在 API 请求的各个阶段介入,包括请求数据的生成、请求发送前的预校验、以及响应接收后的深度验证。 +* **可重用性与模块化**:常见的验证逻辑可以封装在辅助函数或基类中,方便在多个测试用例间共享。 + +在测试执行期间,测试编排器(`APITestOrchestrator`)会自动发现、加载并执行适用于当前 API 端点的所有已注册的 `APITestCase` 实例。 + +## 2. 如何创建自定义测试用例 + +创建一个新的测试用例涉及以下步骤: + +1. **创建 Python 文件**:在指定的测试用例目录(例如 `custom_testcases/`)下创建一个新的 `.py` 文件。建议文件名能反映其测试内容,例如 `header_validation_tests.py`。 +2. **继承 `BaseAPITestCase`**:在文件中定义一个或多个类,使其继承自 `your_project.test_framework_core.BaseAPITestCase` (请替换为实际路径)。 +3. **定义元数据**:在您的自定义测试用例类中,必须定义以下类属性: + * `id: str`: 测试用例的全局唯一标识符。建议使用前缀来分类,例如 `"TC-HEADER-001"`。 + * `name: str`: 人类可读的测试用例名称,例如 `"必要请求头 X-Tenant-ID 存在性检查"`。 + * `description: str`: 对测试用例目的和范围的详细描述。 + * `severity: TestSeverity`: 测试用例的严重程度,使用 `TestSeverity` 枚举(例如 `TestSeverity.CRITICAL`, `TestSeverity.HIGH`, `TestSeverity.MEDIUM`, `TestSeverity.LOW`, `TestSeverity.INFO`)。 + * `tags: List[str]`: 一个字符串列表,用于对测试用例进行分类和过滤,例如 `["header", "security", "core-functionality"]`。 +4. **可选:控制适用范围**:您可以选择性地定义以下类属性来限制测试用例的应用范围: + * `applicable_methods: Optional[List[str]]`: 一个 HTTP 方法字符串的列表(大写),例如 `["POST", "PUT"]`。如果定义了此属性,则该测试用例仅应用于具有这些方法的 API 端点。如果为 `None`(默认),则适用于所有方法。 + * `applicable_paths_regex: Optional[str]`: 一个 Python 正则表达式字符串。如果定义了此属性,则该测试用例仅应用于其路径与此正则表达式匹配的 API 端点。如果为 `None`(默认),则适用于所有路径。 +5. **实现验证逻辑**:重写 `BaseAPITestCase` 中一个或多个 `generate_*` 或 `validate_*` 方法来实现您的具体测试逻辑。 + +**示例骨架:** + +```python +# In custom_testcases/my_custom_header_check.py +from your_project.test_framework_core import BaseAPITestCase, TestSeverity, ValidationResult, APIRequestContext, APIResponseContext # 替换为实际路径 +import logging # 推荐为每个测试用例获取 logger + +class MySpecificHeaderCheck(BaseAPITestCase): + # 1. 元数据 + id = "TC-MYHEADER-001" + name = "自定义头部 My-Custom-Header 格式检查" + description = "验证请求中 My-Custom-Header 是否存在且格式为 UUID。" + severity = TestSeverity.MEDIUM + tags = ["custom", "header", "format"] + + # 2. 可选:适用范围 (例如,仅用于 POST 请求) + applicable_methods = ["POST"] + # applicable_paths_regex = r"/api/v1/orders/.*" # 示例:仅用于特定路径模式 + + def __init__(self, endpoint_spec: dict, global_api_spec: dict): + super().__init__(endpoint_spec, global_api_spec) + # self.logger 在基类中已初始化为 logging.getLogger(f"testcase.{self.id}") + self.logger.info(f"测试用例 {self.id} 已针对端点 {self.endpoint_spec.get('path')} 初始化。") + + # 3. 实现验证逻辑 (见下一节) + def generate_headers(self, current_headers: dict) -> dict: + # 示例:确保我们的自定义头存在,如果不存在则添加一个用于测试 + if "My-Custom-Header" not in current_headers: + current_headers["My-Custom-Header"] = "default-test-uuid-value" # 实际应生成有效UUID + return current_headers + + def validate_request_headers(self, headers: dict, request_context: APIRequestContext) -> list[ValidationResult]: + results = [] + custom_header_value = headers.get("My-Custom-Header") + if not custom_header_value: + results.append(ValidationResult(passed=False, message="请求头缺少 'My-Custom-Header'。")) + else: + # 假设有一个 is_valid_uuid 函数 + # if not is_valid_uuid(custom_header_value): + # results.append(ValidationResult(passed=False, message=f"'My-Custom-Header' 的值 '{custom_header_value}' 不是有效的UUID格式。")) + # else: + results.append(ValidationResult(passed=True, message="'My-Custom-Header' 存在且格式初步检查通过。")) + return results + + # ... 其他可能需要重写的方法 ... +``` + +## 3. `BaseAPITestCase` 详解 + +`BaseAPITestCase` 提供了一系列可以在子类中重写的方法,这些方法覆盖了 API 测试生命周期的不同阶段。 + +### 3.1 构造函数 (`__init__`) + +```python +def __init__(self, endpoint_spec: Dict[str, Any], global_api_spec: Dict[str, Any]): +``` + +* 当测试编排器为某个 API 端点实例化您的测试用例时,会调用此构造函数。 +* **参数**: + * `endpoint_spec: Dict[str, Any]`: 当前正在测试的 API 端点的详细定义。这些信息直接来自 YAPI/Swagger 解析器解析得到的该端点的具体规范,例如包含路径、方法、参数定义(路径参数、查询参数、请求头参数)、请求体 schema、响应 schema 等。您可以使用这些信息来指导您的测试逻辑,例如,了解哪些字段是必需的,它们的数据类型是什么等。 + * `global_api_spec: Dict[str, Any]`: 完整的 API 规范文档(例如,整个 YAPI 导出的 JSON 数组或整个 Swagger JSON 对象)。这允许测试用例在需要时访问 API 规范的全局信息,比如全局定义、标签、分类等。 +* **注意**: 基类 `__init__` 方法会初始化 `self.endpoint_spec`, `self.global_api_spec` 和 `self.logger`。如果您重写 `__init__`,请务必调用 `super().__init__(endpoint_spec, global_api_spec)`。 + +### 3.2 请求生成与修改方法 + +这些方法在测试编排器构建 API 请求之前被调用,允许您动态地修改或生成请求的各个部分。这对于构造特定的测试场景(例如,发送无效数据、测试边界条件、注入特定测试值)非常有用。 + +对于每个 API 端点,测试编排器会先尝试根据 API 规范(YAPI/Swagger)生成一个"基线"的请求(包含必要的参数、基于 schema 的请求体等)。然后,您的测试用例的 `generate_*` 方法会被调用,并传入这个基线数据作为参数,您可以对其进行修改。 + +1. **`generate_query_params(self, current_query_params: Dict[str, Any]) -> Dict[str, Any]`** + * **何时调用**: 在确定请求的查询参数时。 + * **输入**: `current_query_params` - 一个字典,包含测试编排器根据 API 规范(例如 `endpoint_spec['req_query']`)和可能的默认值生成的当前查询参数。 + * **输出**: 您必须返回一个字典,该字典将作为最终发送请求时使用的查询参数。您可以添加、删除或修改 `current_query_params` 中的条目。 + * **用途**: 注入特定的查询参数值,测试不同的过滤条件、分页参数组合等。 + +2. **`generate_headers(self, current_headers: Dict[str, str]) -> Dict[str, str]`** + * **何时调用**: 在确定请求头时。 + * **输入**: `current_headers` - 一个字典,包含测试编排器生成的当前请求头(可能包含如 `Content-Type`, `Accept` 等默认头,以及 API 规范中定义的请求头)。 + * **输出**: 您必须返回一个字典,作为最终的请求头。 + * **用途**: 添加/修改认证令牌 (`Authorization`)、租户ID (`X-Tenant-ID`)、自定义测试头等。 + +3. **`generate_request_body(self, current_body: Optional[Any]) -> Optional[Any]`** + * **何时调用**: 在确定请求体时 (主要用于 `POST`, `PUT`, `PATCH` 等方法)。 + * **输入**: `current_body` - 测试编排器根据 API 规范中的请求体 schema (例如 `endpoint_spec['req_body_other']` for YAPI JSON body, 或 Swagger requestBody schema) 生成的请求体。可能是字典/列表 (对于JSON),字符串或其他类型。 + * **输出**: 您必须返回最终要发送的请求体。 + * **用途**: 构造特定的请求体数据,例如: + * 发送缺少必填字段的数据。 + * 发送类型不匹配的数据。 + * 发送超出范围的数值。 + * 注入用于测试特定业务逻辑的数据。 + +### 3.3 请求预校验方法 + +这些方法在 API 请求的各个部分(URL、头、体)完全构建完成之后,但在实际发送到服务器之前被调用。这允许您在请求发出前对其进行最终的静态检查。 + +每个预校验方法都应返回一个 `List[ValidationResult]`。 + +1. **`validate_request_url(self, url: str, request_context: APIRequestContext) -> List[ValidationResult]`** + * **何时调用**: 请求的完整 URL 构建完毕后。 + * **输入**: + * `url: str`: 最终构建的、将要发送的完整请求 URL。 + * `request_context: APIRequestContext`: 包含当前请求的详细上下文信息(见 4.2 节)。 + * **用途**: 检查 URL 格式是否符合规范(例如 RESTful 路径结构 `/api/{version}/{resource}`)、路径参数是否正确编码、查询参数是否符合命名规范(如全小写+下划线)等。 + +2. **`validate_request_headers(self, headers: Dict[str, str], request_context: APIRequestContext) -> List[ValidationResult]`** + * **何时调用**: 请求头完全确定后。 + * **输入**: + * `headers: Dict[str, str]`: 最终将要发送的请求头。 + * `request_context: APIRequestContext`: 当前请求的上下文。 + * **用途**: 检查是否包含所有必要的请求头 (`X-Tenant-ID`, `Authorization`)、头部字段值是否符合特定格式或约定。 + +3. **`validate_request_body(self, body: Optional[Any], request_context: APIRequestContext) -> List[ValidationResult]`** + * **何时调用**: 请求体完全确定后。 + * **输入**: + * `body: Optional[Any]`: 最终将要发送的请求体。 + * `request_context: APIRequestContext`: 当前请求的上下文。 + * **用途**: 对最终的请求体进行静态检查,例如,检查 JSON 结构是否与预期一致(不一定是严格的 schema 验证,因为那通常在 `generate_request_body` 或由框架处理,但可以做一些更具体的业务逻辑检查)。 + +### 3.4 响应验证方法 + +这是最核心的验证阶段,在从服务器接收到 API 响应后调用。 + +1. **`validate_response(self, response_context: APIResponseContext, request_context: APIRequestContext) -> List[ValidationResult]`** + * **何时调用**: 收到 API 响应后。 + * **输入**: + * `response_context: APIResponseContext`: 包含 API 响应的详细上下文信息(见 4.3 节),如状态码、响应头、响应体内容等。 + * `request_context: APIRequestContext`: 触发此响应的原始请求的上下文。 + * **输出**: 返回一个 `List[ValidationResult]`,包含对该响应的所有验证点的结果。 + * **用途**: 这是进行绝大多数验证的地方,例如: + * 检查 HTTP 状态码是否符合预期。 + * 验证响应头是否包含特定字段及其值。 + * 对响应体内容进行 JSON Schema 验证(可以调用框架提供的 `JSONSchemaValidator`)。 + * 验证响应体中的具体数据是否符合业务规则。 + * 检查错误响应的结构和错误码是否正确。 + +### 3.5 性能与附加检查方法 (可选) + +1. **`check_performance(self, response_context: APIResponseContext, request_context: APIRequestContext) -> List[ValidationResult]`** + * **何时调用**: 收到 API 响应后,通常在主要的 `validate_response` 之后。 + * **输入**: 与 `validate_response` 相同。 + * **输出**: 返回一个 `List[ValidationResult]`。 + * **用途**: 执行与性能相关的检查,最常见的是检查 API 的响应时间 (`response_context.elapsed_time`) 是否在可接受的阈值内。 + +## 4. 核心辅助类 + +这些类是 `BaseAPITestCase` 的重要组成部分,用于传递信息和报告结果。 + +### 4.1 `ValidationResult` + +```python +class ValidationResult: + def __init__(self, passed: bool, message: str, details: Optional[Dict[str, Any]] = None): + self.passed: bool # True 表示验证通过, False 表示失败 + self.message: str # 对验证结果的描述性消息 + self.details: Dict[str, Any] # 可选的字典,用于存储额外信息,如实际值、期望值、上下文等 +``` + +* **用途**: 所有 `validate_*` 和 `check_*` 方法都应返回一个此对象的列表。每个对象代表一个具体的检查点。 +* **示例**: + ```python + results.append(ValidationResult(passed=True, message="状态码为 200 OK。")) + results.append(ValidationResult( + passed=False, + message=f"用户ID不匹配。期望: '{expected_id}', 实际: '{actual_id}'", + details={"expected": expected_id, "actual": actual_id} + )) + ``` + +### 4.2 `APIRequestContext` + +```python +class APIRequestContext: + def __init__(self, method: str, url: str, path_params: Dict[str, Any], + query_params: Dict[str, Any], headers: Dict[str, str], body: Optional[Any]): + self.method: str # HTTP 方法 (e.g., "GET", "POST") + self.url: str # 完整的请求 URL + self.path_params: Dict[str, Any] # 从路径中解析出的参数及其值 + self.query_params: Dict[str, Any]# 最终使用的查询参数 + self.headers: Dict[str, str] # 最终使用的请求头 + self.body: Optional[Any] # 最终使用的请求体 +``` +* **用途**: 在请求相关的钩子方法中提供关于已构建请求的全面信息。 + +### 4.3 `APIResponseContext` + +```python +class APIResponseContext: + def __init__(self, status_code: int, headers: Dict[str, str], + json_content: Optional[Any], text_content: Optional[str], + elapsed_time: float, original_response: Any): + self.status_code: int # HTTP 响应状态码 (e.g., 200, 404) + self.headers: Dict[str, str] # 响应头 + self.json_content: Optional[Any]# 如果响应是JSON且成功解析,则为解析后的对象 (字典或列表),否则为 None + self.text_content: Optional[str]# 原始响应体文本内容 + self.elapsed_time: float # API 调用耗时 (从发送请求到收到完整响应头),单位:秒 + self.original_response: Any # 底层 HTTP 库返回的原始响应对象 (例如 `requests.Response`),供高级用例使用 +``` +* **用途**: 在响应相关的钩子方法中提供关于收到的 API 响应的全面信息。 + +### 4.4 `TestSeverity` 枚举 + +```python +from enum import Enum + +class TestSeverity(Enum): + CRITICAL = "严重" + HIGH = "高" + MEDIUM = "中" + LOW = "低" + INFO = "信息" +``` +* **用途**: 用于定义测试用例的严重级别,方便报告和结果分析。 + +## 5. 日志记录 + +`BaseAPITestCase` 在其 `__init__` 方法中为每个测试用例实例初始化了一个标准的 Python logger: +`self.logger = logging.getLogger(f"testcase.{self.id}")` + +您可以在测试用例的任何方法中使用 `self.logger` 来输出调试信息、执行流程或遇到的问题。 + +**示例**: +```python +self.logger.info(f"正在为端点 {self.endpoint_spec['path']} 生成请求体...") +if error_condition: + self.logger.warning(f"在为 {self.endpoint_spec['title']} 处理数据时遇到警告: {error_condition}") +``` +这些日志将由应用程序的整体日志配置进行管理。 + +## 6. 简单示例:检查状态码和响应时间 + +```python +# In custom_testcases/basic_response_checks.py +from your_project.test_framework_core import BaseAPITestCase, TestSeverity, ValidationResult, APIRequestContext, APIResponseContext + +class StatusCode200Check(BaseAPITestCase): + id = "TC-STATUS-001" + name = "状态码 200 OK 检查" + description = "验证 API 是否成功响应并返回状态码 200。" + severity = TestSeverity.CRITICAL + tags = ["status_code", "smoke"] + + # 此测试用例适用于所有端点,因此无需定义 applicable_methods 或 applicable_paths_regex + + def validate_response(self, response_context: APIResponseContext, request_context: APIRequestContext) -> list[ValidationResult]: + results = [] + if response_context.status_code == 200: + results.append(ValidationResult(passed=True, message="响应状态码为 200 OK。")) + else: + results.append(ValidationResult( + passed=False, + message=f"期望状态码 200,但收到 {response_context.status_code}。", + details={ + "expected_status": 200, + "actual_status": response_context.status_code, + "response_body_sample": (response_context.text_content or "")[:200] # 包含部分响应体以帮助诊断 + } + )) + return results + +class ResponseTimeCheck(BaseAPITestCase): + id = "TC-PERF-001" + name = "API 响应时间检查 (小于1秒)" + description = "验证 API 响应时间是否在 1000 毫秒以内。" + severity = TestSeverity.MEDIUM + tags = ["performance"] + + MAX_RESPONSE_TIME_SECONDS = 1.0 # 1 秒 + + def check_performance(self, response_context: APIResponseContext, request_context: APIRequestContext) -> list[ValidationResult]: + results = [] + elapsed_ms = response_context.elapsed_time * 1000 + if response_context.elapsed_time <= self.MAX_RESPONSE_TIME_SECONDS: + results.append(ValidationResult( + passed=True, + message=f"响应时间 {elapsed_ms:.2f}ms,在阈值 {self.MAX_RESPONSE_TIME_SECONDS*1000:.0f}ms 以内。" + )) + else: + results.append(ValidationResult( + passed=False, + message=f"响应时间过长: {elapsed_ms:.2f}ms。期望小于 {self.MAX_RESPONSE_TIME_SECONDS*1000:.0f}ms。", + details={"actual_ms": elapsed_ms, "threshold_ms": self.MAX_RESPONSE_TIME_SECONDS*1000} + )) + return results +``` + +## 7. 最佳实践和注意事项 + +* **保持测试用例的单一职责**:尽量让每个 `APITestCase` 类专注于一个特定的验证目标或一小组紧密相关的检查点。这使得测试用例更易于理解、维护和调试。 +* **清晰的命名**:为您的测试用例类、`id` 和 `name` 使用清晰、描述性的名称。 +* **充分利用 `endpoint_spec`**:在测试逻辑中,参考 `self.endpoint_spec` 来了解 API 的预期行为、参数、schema 等,使您的测试更加精确。 +* **详细的 `ValidationResult` 消息**:当验证失败时,提供足够详细的 `message` 和 `details`,以便快速定位问题。 +* **考虑性能**:虽然灵活性是关键,但避免在测试用例中执行过于耗时的操作,除非是专门的性能测试。 +* **错误处理**:在您的测试用例代码中妥善处理可能发生的异常,并使用 `self.logger` 记录它们。 +* **可重用逻辑**:如果多个测试用例需要相似的逻辑(例如,解析特定的响应结构、生成特定的测试数据),考虑将这些逻辑提取到共享的辅助函数或一个共同的基类中(您的测试用例可以继承自这个中间基类,而这个中间基类继承自 `BaseAPITestCase`)。 +* **逐步实现**:从简单的测试用例开始,逐步构建更复杂的验证逻辑。 + +通过遵循本指南,您将能够有效地利用 `APITestCase` 机制为您的 DDMS 合规性验证软件构建强大而灵活的自动化测试。 \ No newline at end of file diff --git a/prompt.md b/prompt.md new file mode 100644 index 0000000..b16616e --- /dev/null +++ b/prompt.md @@ -0,0 +1,87 @@ +需要改进的地方是我想实现一个机制,能够灵活地增加各种测试方法,现在的规则库我觉得不够好,我想完全重新设计,你帮我想想怎么能够实现一种强大的自定义规则库的方法(是不是完全用代码定义规则好一点?我需要你帮我设计)比如说至少要支持下面这些规则,怎么把这些验证添加到header、响应、url中,或者定义并行测试等等,我不是很清楚,你一定给我一个强大通用的设计,具体的测试功能可以先不考虑,先想想这个架构。比如域名要求是动宾结构,我就可以在这里添加大模型测试。是不是让用户自定义validate函数比较好,比如可以定义生成query的函数,定义验证url的函数,定义验证响应的函数,不同的函数自动加到不同的部分来验证,还可以定义额外的并行参数、对于响应时间等参数的测试函数等,就是提供一个testcase模板,这样也容易灵活添加,你觉得怎么样:一、 核心功能测试 + +1. 数据存取服务接口测试: + +- 标准化查询接口验证: 测试数据查询接口,覆盖不同查询条件,验证返回结果的准确性和完整性。 +- 标准化读取接口验证: 测试数据读取接口,验证特定标识数据的准确获取。 +- 标准化写入接口验证: 测试数据写入接口,验证数据正确持久化,并考虑边界值、异常值写入。 +- 输出格式验证: 确保所有数据存取服务的输出符合定义的数据交换格式 (JSON Schema)。 + +2. 状态监控接口测试: + +- 实时状态反馈验证: 调用状态监控接口,验证返回的系统运行状态、接口健康度信息的准确性和实时性。 + +3. 专业领域扩展接口测试: + +- 遵循总则要求验证: 对各专业领域扩展的数据服务接口,均需重新应用本总则中的所有相关测试点。 +- 专业领域数据交换模型验证: 验证其是否按照该专业领域的特定应用要求进行设置和交互。 + 二、 数据服务接口规范性测试 (对应规范第7部分) + +1. 通用技术实现测试: + +- OpenAPI规范符合性验证: + - 验证实际API行为与描述是否一致(路径、参数、方法、响应码、数据结构等)。 +- JSON序列化验证: 确保所有请求和响应的数据都使用有效的JSON格式进行序列化。 + +2. 数据服务接口功能与设计原则测试: + +- 可靠性存取验证: 进行长时间、多并发的数据操作,验证其可靠性。 +- 分页查询功能验证: 测试不同的页码、每页数量,验证返回数据子集的正确性、边界条件(首页、末页、空页)。 +- 条件过滤功能验证: 测试多种有效和无效的过滤条件组合,验证结果集的准确性。 +- RESTful API设计原则符合性验证: + - HTTP方法使用: 验证GET(检索)、POST(创建)、PUT(更新)、DELETE(删除)的正确使用。测试对不支持的方法返回405。 + - 接口命名语义化: 评审接口名称是否为动词+名词,比如GetWellLog + - 路径结构: 验证路径是否遵循 /{专业}/{版本号}/资源类型 格式。 + - 资源命名: 验证资源集合是否用复数,术语是否为行业标准。 +- 请求头验证: + - 必含字段: + - X-Tenant-ID 测试: 验证包含、缺失、无效租户标识的场景下的行为,特别是数据隔离性。 + - Authorization (Bearer令牌) 测试: 验证包含有效令牌、缺失令牌、无效/过期令牌的场景。 + - X-Data-Domain:数据域声明,比如logging +- 路径参数测试: 全小写+下划线命名 +- 查询参数测试: 测试过滤、分页、排序参数的有效组合及无效输入的处理。 +- 错误响应结构验证: 触发错误,验证响应是否为包含code、message的结构化错误码(参照附录B)。 + +3. 模型管理接口功能与安全测试: + +- 元信息管理功能验证: 测试数据字典、权限策略、接口版本等元信息的增删改查功能(若API提供)。 +- 动态配置与审计追踪验证: 测试动态配置的生效情况,验证相关操作是否产生审计记录(若可查)。 +- 敏感元数据访问限制: 验证不同权限用户对敏感元数据的访问是否受控。 + +4. 兼容性测试: + +- URL版本号嵌入与多版本共存验证: 验证URL中是否包含版本号 (如 /v1/datasets)。 + +5. 服务质量测试): + +- 分页控制有效性: 验证分页参数能有效控制响应数据量。 + 四、 安全要求测试 + +1. 传输安全测试: + +- HTTPS协议强制性验证: 验证所有接口是否仅能通过HTTPS访问,HTTP访问是否被拒绝或重定向。 +- 认证鉴权方法验证: + - 无凭证访问: 尝试在未提供认证信息的情况下访问受保护接口,验证是否返回401或类似错误。 + - 无效/过期凭证访问: 使用无效或过期的令牌/凭证访问,验证是否被拒绝。 + +2. 敏感数据防护测试: + +- 敏感字段加密传输验证: 抓包分析(在HTTPS解密后,若测试环境允许)或通过响应内容,验证规范中定义的敏感字段是否按要求(如SM4算法)进行了字段级加密(此项可能需要特定配合或白盒信息)。通常HTTPS已保障传输层加密。 +- 强制加密传输验证: 验证在认证鉴权后,传输内容是否仍然强制通过加密信道(HTTPS)。 + +3. 访问控制测试: + +- 权限分离验证: + - 使用不同角色的账户/令牌,分别测试其对数据进行增加、删除、修改、查询等操作的权限。 + - 验证用户A无法访问/操作用户B或其他租户的数据(除非明确授权)。 + - 验证低权限用户无法执行高权限操作。 + - 对未授权的操作,验证是否返回403或类似错误。 + 五、 附录B (JSON关键字与错误代码) 符合性测试 +- 特定错误场景触发与代码验证: + - 类型校验失败 (4001): 发送与Schema定义类型不符的数据 (如string代替number)。 + - 必填字段缺失 (4003): 请求中缺少Schema定义的必填字段。 + - 数值越界 (4002): 发送超出Schema定义minimum/maximum范围的数值。 + - 自定义格式校验失败 (4004): 发送不符合Schema中format定义的数据 (如无效的email、date-time)。 + - 数组元素重复 (4005): 若Schema定义了uniqueItems: true,发送包含重复元素的数组。 + - 非法枚举值 (4006): 发送不在Schema中enum定义列表内的值。 + - 对以上每种情况,验证API是否返回对应的、正确的错误码和描述。 diff --git a/tests/__pycache__/test_test_case_registry.cpython-312.pyc b/tests/__pycache__/test_test_case_registry.cpython-312.pyc new file mode 100644 index 0000000..c89e2fc Binary files /dev/null and b/tests/__pycache__/test_test_case_registry.cpython-312.pyc differ diff --git a/tests/mock_seismic_api.py b/tests/mock_seismic_api.py deleted file mode 100644 index 2eff197..0000000 --- a/tests/mock_seismic_api.py +++ /dev/null @@ -1,638 +0,0 @@ -""" -地震体 API 模拟服务器 - -用于模拟地震体相关的 API 接口,用于测试 DDMS 合规性验证软件。 -""" - -import json -import logging -import uuid -import time -import random -from typing import Dict, Any, List, Optional, Tuple -from flask import Flask, request, jsonify, Response, send_file -import io -import numpy as np - -# 配置日志 -logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') -logger = logging.getLogger(__name__) - -app = Flask(__name__) - -# 内存数据存储 -seismic_files = {} # 存储地震体文件信息 -export_tasks = {} # 存储导出任务信息 -import_tasks = {} # 存储导入任务信息 -seismic_data = {} # 存储地震体数据 - -# 生成唯一ID -def generate_id(): - current_time = int(time.time() * 1000) - return f"{current_time}_{random.randint(1, 10)}" - -# 初始化一些样例数据 -def init_sample_data(): - # 添加一个样例地震体 - sample_seismic_id = "20221113181927_1" - seismic_files[sample_seismic_id] = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "Sample_Seismic", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 1, - "serviceMax": 100, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 1, - "serviceMax": 100, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - # 初始化地震体数据 (简单的随机数据) - seismic_data[sample_seismic_id] = { - "traces": {}, # 存储道数据 {(inline, xline): values} - "h3200": b"Sample 3200 Header Data", - "h400": b"Sample 400 Header Data", - "h240": {1: b"Sample 240 Header Data for trace 1"}, - "keywords": { - "h400": [{"name": "Sample H400 Keyword", "value": "Sample Value"}], - "h240": [{"name": "Sample H240 Keyword", "value": "Sample Value"}], - "gather": [{"name": "Sample Gather Keyword", "value": "Sample Value"}] - }, - "coordinates": { - # 坐标映射 {(x, y): (inline, xline)} - (606406.1281141682, 6082083.338731234): (440, 333), - (609767.8725899048, 6080336.549935018): (366, 465), - (615271.9052119441, 6082017.422172886): (427, 686), - (612173.8269695987, 6084291.543435885): (521, 566) - } - } - -# 5.1.1 新建地震体文件 -@app.route('/api/gsc/appmodel/api/v1/seismic/file/add', methods=['POST']) -def add_seismic_file(): - try: - data = request.json - seismic_id = generate_id() - - # 存储地震体信息 - seismic_files[seismic_id] = data - - # 初始化地震体数据 - seismic_data[seismic_id] = { - "traces": {}, - "h3200": b"Default 3200 Header Data", - "h400": b"Default 400 Header Data", - "h240": {}, - "keywords": { - "h400": [], - "h240": [], - "gather": [] - }, - "coordinates": {} - } - - return jsonify({ - "code": "0", - "msg": "", - "flag": True, - "result": seismic_id - }) - except Exception as e: - logger.error(f"Error adding seismic file: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.2 Inline 写入三维地震体文件 -@app.route('/api/gsc/appmodel/api/v1/seismic/3d/inline/writer/array', methods=['POST']) -def write_inline_array(): - try: - data = request.json - seismic_id = data.get('seismicId') - inline_no = data.get('inlineNo') - values = data.get('values', []) - - if seismic_id not in seismic_data: - return jsonify({ - "msg": "Seismic file not found", - "code": 1, - "result": "" - }), 404 - - # 存储道数据 - for xline_idx, trace_values in enumerate(values[0]): - xline_no = seismic_files[seismic_id]['dimensions'][1]['serviceMin'] + xline_idx - seismic_data[seismic_id]["traces"][(inline_no, xline_no)] = trace_values - - return jsonify({ - "msg": "success", - "code": 0, - "result": "" - }) - except Exception as e: - logger.error(f"Error writing inline array: {e}") - return jsonify({ - "msg": str(e), - "code": 1, - "result": "" - }), 500 - -# 5.1.3 3D 任意道写入三维地震体文件 -@app.route('/api/gsc/appmodel/api/v1/seismic/3d/writer/any/array', methods=['POST']) -def write_any_array(): - try: - data = request.json - seismic_id = data.get('seismicId') - traces = data.get('traces', []) - - if seismic_id not in seismic_data: - return jsonify({ - "msg": "Seismic file not found", - "code": 1, - "result": "" - }), 404 - - # 存储道数据 - for trace in traces: - inline_no = trace.get('inlineNo') - xline_no = trace.get('xlineNo') - values = trace.get('values', []) - seismic_data[seismic_id]["traces"][(inline_no, xline_no)] = values - - return jsonify({ - "msg": "success", - "code": 0, - "result": "" - }) - except Exception as e: - logger.error(f"Error writing any array: {e}") - return jsonify({ - "msg": str(e), - "code": 1, - "result": "" - }), 500 - -# 5.1.4 导出地震体—提交任务 -@app.route('/api/gsc/appmodel/api/v1/seismic/export/submit', methods=['POST']) -def submit_export(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 创建导出任务 - task_id = f"export_{generate_id()}" - export_tasks[task_id] = { - "seismicId": seismic_id, - "status": "submitted", - "progress": 0, - "saveDir": data.get('saveDir', f"/export/{seismic_id}.sgy") - } - - # 模拟任务开始处理 - def process_task(): - for i in range(1, 11): - export_tasks[task_id]["progress"] = i * 10 - time.sleep(0.5) # 模拟处理时间 - export_tasks[task_id]["status"] = "completed" - - # 启动后台线程处理任务 - import threading - thread = threading.Thread(target=process_task) - thread.daemon = True - thread.start() - - return jsonify({ - "code": "0", - "msg": "操作成功!", - "flag": True, - "result": { - "taskId": task_id, - "status": "submitted", - "progress": 0 - } - }) - except Exception as e: - logger.error(f"Error submitting export task: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.5 导出地震体—查询进度 -@app.route('/api/gsc/appmodel/api/v1/seismic/export/progress', methods=['GET']) -def query_export_progress(): - try: - task_id = request.args.get('taskId') - - if task_id not in export_tasks: - return jsonify({ - "code": "1", - "msg": "Task not found", - "flag": False, - "result": None - }), 404 - - task = export_tasks[task_id] - - return jsonify({ - "code": "0", - "msg": "操作成功!", - "flag": True, - "result": { - "taskId": task_id, - "status": task["status"], - "progress": task["progress"] - } - }) - except Exception as e: - logger.error(f"Error querying export progress: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.6 导出地震体—下载 -@app.route('/api/gsc/appmodel/api/v1/seismic/export/download', methods=['GET']) -def download_export(): - try: - task_id = request.args.get('taskId') - - if task_id not in export_tasks: - return jsonify({ - "code": "1", - "msg": "Task not found", - "flag": False, - "result": None - }), 404 - - task = export_tasks[task_id] - - if task["status"] != "completed": - return jsonify({ - "code": "1", - "msg": "Task not completed", - "flag": False, - "result": None - }), 400 - - # 创建一个模拟的SEG-Y文件 - dummy_segy = io.BytesIO() - # 添加一些随机二进制数据 - dummy_segy.write(b"FAKE SEGY FILE CONTENT") - dummy_segy.seek(0) - - # 如果 delFile 参数设置为 true,删除任务 - if request.args.get('delFile') == '1': - export_tasks.pop(task_id, None) - - return send_file( - dummy_segy, - mimetype='application/octet-stream', - as_attachment=True, - download_name=f"seismic_{task['seismicId']}.sgy" - ) - except Exception as e: - logger.error(f"Error downloading export: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.7 查询地震体 3200 头 -@app.route('/api/gsc/appmodel/api/v1/seismic/head/h3200', methods=['POST']) -def get_h3200(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 返回二进制数据 - return Response( - seismic_data[seismic_id]["h3200"], - mimetype='application/octet-stream' - ) - except Exception as e: - logger.error(f"Error getting h3200: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.8 查询地震体 400 头 -@app.route('/api/gsc/appmodel/api/v1/seismic/head/h400', methods=['POST']) -def get_h400(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 返回二进制数据 - return Response( - seismic_data[seismic_id]["h400"], - mimetype='application/octet-stream' - ) - except Exception as e: - logger.error(f"Error getting h400: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.9 查询地震体总道数 -@app.route('/api/gsc/appmodel/api/v1/seismic/traces/count', methods=['POST']) -def get_traces_count(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 获取道数 - trace_count = len(seismic_data[seismic_id]["traces"]) - - return jsonify({ - "msg": "success", - "code": 0, - "result": str(trace_count) - }) - except Exception as e: - logger.error(f"Error getting traces count: {e}") - return jsonify({ - "msg": str(e), - "code": 1, - "result": "" - }), 500 - -# 5.1.10 查询地震体 240 头 -@app.route('/api/gsc/appmodel/api/v1/seismic/head/h240', methods=['POST']) -def get_h240(): - try: - data = request.json - seismic_id = data.get('seismicId') - trace_index = data.get('traceIndex') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 获取道头数据 - if trace_index not in seismic_data[seismic_id]["h240"]: - # 如果不存在,生成一个随机的道头数据 - seismic_data[seismic_id]["h240"][trace_index] = f"Sample 240 Header Data for trace {trace_index}".encode() - - # 返回二进制数据 - return Response( - seismic_data[seismic_id]["h240"][trace_index], - mimetype='application/octet-stream' - ) - except Exception as e: - logger.error(f"Error getting h240: {e}") - return jsonify({ - "code": "1", - "msg": str(e), - "flag": False, - "result": None - }), 500 - -# 5.1.11 查询地震体卷头关键字信息 -@app.route('/api/gsc/appmodel/api/v1/seismic/h400/keyword/list', methods=['POST']) -def get_h400_keywords(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - return jsonify({ - "flag": True, - "msg": "success", - "code": 0, - "result": seismic_data[seismic_id]["keywords"]["h400"] - }) - except Exception as e: - logger.error(f"Error getting h400 keywords: {e}") - return jsonify({ - "flag": False, - "msg": str(e), - "code": 1, - "result": None - }), 500 - -# 5.1.12 查询地震体道头关键字信息 -@app.route('/api/gsc/appmodel/api/v1/seismic/h240/keyword/list', methods=['POST']) -def get_h240_keywords(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - return jsonify({ - "flag": True, - "msg": "success", - "code": 0, - "result": seismic_data[seismic_id]["keywords"]["h240"] - }) - except Exception as e: - logger.error(f"Error getting h240 keywords: {e}") - return jsonify({ - "flag": False, - "msg": str(e), - "code": 1, - "result": None - }), 500 - -# 5.1.13 查询地震体道集关键字信息 -@app.route('/api/gsc/appmodel/api/v1/seismic/gather/keyword/list', methods=['POST']) -def get_gather_keywords(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - return jsonify({ - "flag": True, - "msg": "success", - "code": 0, - "result": seismic_data[seismic_id]["keywords"]["gather"] - }) - except Exception as e: - logger.error(f"Error getting gather keywords: {e}") - return jsonify({ - "flag": False, - "msg": str(e), - "code": 1, - "result": None - }), 500 - -# 5.1.14 导入地震体—查询进度 -@app.route('/api/gsc/appmodel/api/v1/seismic/import/progress', methods=['POST']) -def query_import_progress(): - try: - data = request.json - seismic_id = data.get('seismicId') - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 检查是否存在导入任务 - task_id = f"import_{seismic_id}" - if task_id not in import_tasks: - # 创建一个模拟的导入任务 - import_tasks[task_id] = { - "seismicId": seismic_id, - "status": "completed", - "progress": 100 - } - - task = import_tasks[task_id] - - return jsonify({ - "msg": "success", - "code": 0, - "result": { - "taskId": task_id, - "status": task["status"], - "progress": task["progress"] - } - }) - except Exception as e: - logger.error(f"Error querying import progress: {e}") - return jsonify({ - "msg": str(e), - "code": 1, - "result": None - }), 500 - -# 5.1.15 查询地震体点线坐标 -@app.route('/api/gsc/appmodel/api/v1/seismic/coordinate/geodetic/toline', methods=['POST']) -def convert_coordinates(): - try: - data = request.json - seismic_id = data.get('seismicId') - points = data.get('points', []) - - if seismic_id not in seismic_data: - return jsonify({ - "code": "1", - "msg": "Seismic file not found", - "flag": False, - "result": None - }), 404 - - # 转换坐标 - result = [] - for point in points: - x, y = point - # 查找最接近的已知坐标点 - if (x, y) in seismic_data[seismic_id]["coordinates"]: - result.append(list(seismic_data[seismic_id]["coordinates"][(x, y)])) - else: - # 如果找不到精确匹配,返回模拟数据 - result.append([random.randint(1, 100), random.randint(1, 100)]) - - return jsonify({ - "msg": "success", - "code": 0, - "result": result - }) - except Exception as e: - logger.error(f"Error converting coordinates: {e}") - return jsonify({ - "msg": str(e), - "code": 1, - "result": None - }), 500 - -# 初始化样例数据 -init_sample_data() - -if __name__ == '__main__': - app.run(host='0.0.0.0', port=5001, debug=True) \ No newline at end of file diff --git a/tests/run_mock_seismic_api.py b/tests/run_mock_seismic_api.py deleted file mode 100644 index eb6efc6..0000000 --- a/tests/run_mock_seismic_api.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -启动地震体 API 模拟服务器 - -启动 mock_seismic_api.py 中定义的 Flask 应用, -用于在本地端口 5001 上提供模拟的地震体 API 服务。 -""" - -import os -import sys -from pathlib import Path - -# 添加项目根目录到 Python 路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -# 导入模拟 API 服务器模块 -from tests.mock_seismic_api import app - -if __name__ == "__main__": - print("启动地震体 API 模拟服务器在 http://localhost:5001/") - print("使用 Ctrl+C 停止服务器") - app.run(host='0.0.0.0', port=5001, debug=True) \ No newline at end of file diff --git a/tests/test_api_caller.py b/tests/test_api_caller.py deleted file mode 100644 index de000cd..0000000 --- a/tests/test_api_caller.py +++ /dev/null @@ -1,219 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -API Caller Test Module - -Unit tests for ddms_compliance_suite.api_caller.caller module, -validates API request and response handling. -""" - -import os -import sys -import unittest -import json -from unittest import mock -from pathlib import Path - -# Add project root to Python path -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest, APIResponse - -class MockResponse: - """Mock class for requests response""" - def __init__(self, json_data, status_code, headers=None, content=None, elapsed_seconds=0.1): - self.json_data = json_data - self.status_code = status_code - self.headers = headers or {"Content-Type": "application/json"} - self.content = content or json.dumps(json_data).encode('utf-8') - self.elapsed = mock.Mock() - self.elapsed.total_seconds.return_value = elapsed_seconds - - def json(self): - return self.json_data - - def raise_for_status(self): - if self.status_code >= 400: - from requests.exceptions import HTTPError - raise HTTPError(f"HTTP Error: {self.status_code}") - -class TestAPICaller(unittest.TestCase): - """API Caller Test Class""" - - def setUp(self): - """Setup before tests""" - self.api_caller = APICaller( - default_timeout=30, # Match the default timeout in the actual implementation - default_headers={"X-Test": "test-value"} - ) - - @mock.patch('requests.request') - def test_successful_get_request(self, mock_request): - """Test successful GET request""" - # Set mock return value - mock_response = MockResponse( - json_data={"message": "success", "data": {"id": 1, "name": "Test Project"}}, - status_code=200 - ) - mock_request.return_value = mock_response - - # Create request object - request = APIRequest( - method="GET", - url="https://api.example.com/test", - params={"id": 1} - ) - - # Execute request - response = self.api_caller.call_api(request) - - # Validate - self.assertEqual(response.status_code, 200) - self.assertEqual(response.json_content["message"], "success") - self.assertEqual(response.json_content["data"]["name"], "Test Project") - - # Validate mock call with proper timeout - mock_request.assert_called_once_with( - method="GET", - url="https://api.example.com/test", - headers={"X-Test": "test-value"}, - params={"id": 1}, - json=None, - data=None, - timeout=30 # Default timeout from the implementation - ) - - @mock.patch('requests.request') - def test_successful_post_request(self, mock_request): - """Test successful POST request""" - # Set mock return value - mock_response = MockResponse( - json_data={"message": "created", "id": 123}, - status_code=201 - ) - mock_request.return_value = mock_response - - # Create request object - request = APIRequest( - method="POST", - url="https://api.example.com/create", - json_data={"name": "New Test Project", "description": "Test Description"}, - headers={"Content-Type": "application/json"} - ) - - # Execute request - response = self.api_caller.call_api(request) - - # Validate - self.assertEqual(response.status_code, 201) - self.assertEqual(response.json_content["message"], "created") - self.assertEqual(response.json_content["id"], 123) - - # Validate mock call with proper timeout - mock_request.assert_called_once_with( - method="POST", - url="https://api.example.com/create", - headers={"X-Test": "test-value", "Content-Type": "application/json"}, - params=None, - json={"name": "New Test Project", "description": "Test Description"}, - data=None, - timeout=30 # Default timeout from the implementation - ) - - @mock.patch('requests.request') - def test_error_request(self, mock_request): - """Test request failure case""" - # Set mock to raise exception - from requests.exceptions import HTTPError - mock_response = mock.Mock() - mock_response.status_code = 404 - mock_response.headers = {"Content-Type": "application/json"} - mock_response.content = b"Not Found" - - # Create a proper HTTPError with response attached - http_error = HTTPError("404 Client Error") - http_error.response = mock_response - mock_request.side_effect = http_error - - # Create request object - request = APIRequest( - method="GET", - url="https://api.example.com/nonexistent" - ) - - # Execute request - response = self.api_caller.call_api(request) - - # Validate - self.assertEqual(response.status_code, 404) - self.assertIsNone(response.json_content) - - @mock.patch('requests.request') - def test_non_json_response(self, mock_request): - """Test non-JSON response""" - # Create a real mock for requests.request - content = b"Non-JSON content" - mock_response = mock.Mock() - mock_response.status_code = 200 - mock_response.headers = {"Content-Type": "text/plain"} - mock_response.content = content - mock_response.elapsed.total_seconds.return_value = 0.1 - - # Setup the JSON decode error when json() is called - from requests.exceptions import JSONDecodeError - mock_response.json.side_effect = JSONDecodeError("Invalid JSON", "", 0) - - # Set the mock response for the request - mock_request.return_value = mock_response - - # Create request object - request = APIRequest( - method="GET", - url="https://api.example.com/text" - ) - - # Execute request - response = self.api_caller.call_api(request) - - # Validate - self.assertEqual(response.status_code, 200) - self.assertEqual(response.content, b"Non-JSON content") - self.assertIsNone(response.json_content) - - @mock.patch('requests.request') - def test_custom_timeout(self, mock_request): - """Test custom timeout setting""" - # Set mock return value - mock_response = MockResponse( - json_data={"message": "success"}, - status_code=200 - ) - mock_request.return_value = mock_response - - # Create request object with custom timeout - request = APIRequest( - method="GET", - url="https://api.example.com/slow", - timeout=10 - ) - - # Execute request - response = self.api_caller.call_api(request) - - # Validate - self.assertEqual(response.status_code, 200) - - # Validate mock call used custom timeout - mock_request.assert_called_once_with( - method="GET", - url="https://api.example.com/slow", - headers={"X-Test": "test-value"}, - params=None, - json=None, - data=None, - timeout=10 # Custom timeout specified in the request - ) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_api_schema_integration.py b/tests/test_api_schema_integration.py deleted file mode 100644 index 270845a..0000000 --- a/tests/test_api_schema_integration.py +++ /dev/null @@ -1,443 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -API 调用器和 JSON Schema 验证器的集成测试 - -本测试模块验证 API 调用器获取的数据是否能够被 JSON Schema 验证器正确验证, -测试两个组件能否协同工作。 -""" - -import os -import sys -import unittest -import json -from unittest import mock -from pathlib import Path - -# 添加项目根目录到 Python 路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator -from ddms_compliance_suite.models.rule_models import JSONSchemaDefinition, RuleCategory, TargetType - -class MockResponse: - """Mock 类用于模拟 requests 的响应""" - def __init__(self, json_data, status_code, headers=None, content=None, elapsed_seconds=0.1): - self.json_data = json_data - self.status_code = status_code - self.headers = headers or {"Content-Type": "application/json"} - self.content = content or json.dumps(json_data).encode('utf-8') - self.elapsed = mock.Mock() - self.elapsed.total_seconds.return_value = elapsed_seconds - - def json(self): - return self.json_data - - def raise_for_status(self): - if self.status_code >= 400: - from requests.exceptions import HTTPError - raise HTTPError(f"HTTP Error: {self.status_code}") - -class TestAPISchemaIntegration(unittest.TestCase): - """API 调用器和 JSON Schema 验证器的集成测试类""" - - def setUp(self): - """测试前的设置""" - # 创建 API 调用器实例 - self.api_caller = APICaller( - default_timeout=30, - default_headers={"X-Test": "test-value"} - ) - - # 创建 JSON Schema 验证器实例 - self.schema_validator = JSONSchemaValidator() - - # 井数据的 JSON Schema - self.well_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["wellName", "wellID", "status", "coordinates"], - "properties": { - "wellName": { - "type": "string", - "description": "Well name" - }, - "wellID": { - "type": "string", - "pattern": "^W[0-9]{10}$", - "description": "Well unique identifier, must be W followed by 10 digits" - }, - "status": { - "type": "string", - "enum": ["active", "inactive", "abandoned", "suspended"], - "description": "Current well status" - }, - "coordinates": { - "type": "object", - "required": ["longitude", "latitude"], - "properties": { - "longitude": { - "type": "number", - "minimum": -180, - "maximum": 180, - "description": "Longitude coordinate" - }, - "latitude": { - "type": "number", - "minimum": -90, - "maximum": 90, - "description": "Latitude coordinate" - } - } - } - } - } - - # 地震数据的 JSON Schema - self.seismic_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["projectId", "surveyId", "seismicName", "dimensions"], - "properties": { - "projectId": { - "type": "string", - "description": "Project identifier" - }, - "surveyId": { - "type": "string", - "description": "Survey identifier" - }, - "seismicName": { - "type": "string", - "description": "Seismic volume name" - }, - "dsType": { - "type": "integer", - "enum": [1, 2], - "description": "Dataset type: 1 for base seismic, 2 for attribute body" - }, - "dimensions": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": ["dimensionNo", "dimensionName", "serviceMin", "serviceMax"], - "properties": { - "dimensionNo": { - "type": "integer", - "minimum": 1, - "description": "Dimension number" - }, - "dimensionName": { - "type": "string", - "description": "Dimension name" - }, - "serviceMin": { - "type": "integer", - "description": "Minimum value" - }, - "serviceMax": { - "type": "integer", - "description": "Maximum value" - }, - "serviceSpan": { - "type": "integer", - "description": "Sample interval" - } - } - } - } - }, - "allOf": [ - { - "if": { - "properties": { "dsType": { "enum": [2] } }, - "required": ["dsType"] - }, - "then": { - "required": ["baseSeismicId"], - "properties": { - "baseSeismicId": { - "type": "string", - "description": "Base seismic identifier required for attribute bodies" - } - } - } - } - ] - } - - # 创建 Schema 规则 - self.well_schema_rule = JSONSchemaDefinition( - id="well-data-schema", - name="Well Data Schema", - description="Defines JSON structure for well data", - category=RuleCategory.JSON_SCHEMA, - version="1.0.0", - target_type=TargetType.DATA_OBJECT, - target_identifier="Well", - schema_content=self.well_schema - ) - - self.seismic_schema_rule = JSONSchemaDefinition( - id="seismic-data-schema", - name="Seismic Data Schema", - description="Defines JSON structure for seismic data", - category=RuleCategory.JSON_SCHEMA, - version="1.0.0", - target_type=TargetType.DATA_OBJECT, - target_identifier="Seismic", - schema_content=self.seismic_schema - ) - - @mock.patch('requests.request') - def test_valid_well_data_integration(self, mock_request): - """测试有效井数据的 API 调用和 Schema 验证集成""" - # 设置 mock 返回值 - valid_well_data = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - }, - "depth": 3500, - "operator": "TestCorp" - } - - mock_response = MockResponse( - json_data=valid_well_data, - status_code=200 - ) - mock_request.return_value = mock_response - - # 创建 API 请求 - request = APIRequest( - method="GET", - url="https://api.example.com/wells/W0123456789", - headers={"Accept": "application/json"} - ) - - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证数据符合 Schema - validation_result = self.schema_validator.validate(response.json_content, self.well_schema) - - # 断言 - self.assertTrue(validation_result.is_valid) - self.assertEqual(len(validation_result.errors), 0) - - # 使用规则对象进行验证 - rule_validation_result = self.schema_validator.validate_with_rule(response.json_content, self.well_schema_rule) - self.assertTrue(rule_validation_result.is_valid) - - @mock.patch('requests.request') - def test_invalid_well_data_integration(self, mock_request): - """测试无效井数据的 API 调用和 Schema 验证集成""" - # 设置 mock 返回值 - 缺少必填字段 status - invalid_well_data = { - "wellName": "Test Well-02", - "wellID": "W0123456789", - # 缺少 status - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - mock_response = MockResponse( - json_data=invalid_well_data, - status_code=200 - ) - mock_request.return_value = mock_response - - # 创建 API 请求 - request = APIRequest( - method="GET", - url="https://api.example.com/wells/W0123456789", - headers={"Accept": "application/json"} - ) - - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证数据不符合 Schema - validation_result = self.schema_validator.validate(response.json_content, self.well_schema) - - # 断言 - self.assertFalse(validation_result.is_valid) - self.assertTrue(any("status" in error for error in validation_result.errors)) - - # 使用规则对象进行验证 - rule_validation_result = self.schema_validator.validate_with_rule(response.json_content, self.well_schema_rule) - self.assertFalse(rule_validation_result.is_valid) - - @mock.patch('requests.request') - def test_valid_seismic_data_integration(self, mock_request): - """测试有效地震数据的 API 调用和 Schema 验证集成""" - # 设置 mock 返回值 - valid_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "西部地震体-01", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ], - "sampleRate": 2.0 - } - - mock_response = MockResponse( - json_data=valid_seismic_data, - status_code=200 - ) - mock_request.return_value = mock_response - - # 创建 API 请求 - request = APIRequest( - method="GET", - url="https://api.example.com/seismic/20230117135924_2", - headers={"Accept": "application/json"} - ) - - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证数据符合 Schema - validation_result = self.schema_validator.validate(response.json_content, self.seismic_schema) - - # 断言 - self.assertTrue(validation_result.is_valid) - self.assertEqual(len(validation_result.errors), 0) - - # 使用规则对象进行验证 - rule_validation_result = self.schema_validator.validate_with_rule(response.json_content, self.seismic_schema_rule) - self.assertTrue(rule_validation_result.is_valid) - - @mock.patch('requests.request') - def test_invalid_seismic_data_integration(self, mock_request): - """测试无效地震数据的 API 调用和 Schema 验证集成""" - # 设置 mock 返回值 - 属性体缺少 baseSeismicId - invalid_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "西部地震体-02", - "dsType": 2, # dsType 为 2 时需要 baseSeismicId - # 缺少 baseSeismicId - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - } - - mock_response = MockResponse( - json_data=invalid_seismic_data, - status_code=200 - ) - mock_request.return_value = mock_response - - # 创建 API 请求 - request = APIRequest( - method="GET", - url="https://api.example.com/seismic/20230117135924_2", - headers={"Accept": "application/json"} - ) - - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证数据不符合 Schema - validation_result = self.schema_validator.validate(response.json_content, self.seismic_schema) - - # 断言 - self.assertFalse(validation_result.is_valid) - # 验证错误信息包含 baseSeismicId - self.assertTrue(any("baseSeismicId" in error for error in validation_result.errors)) - - # 使用规则对象进行验证 - rule_validation_result = self.schema_validator.validate_with_rule(response.json_content, self.seismic_schema_rule) - self.assertFalse(rule_validation_result.is_valid) - - @mock.patch('requests.request') - def test_api_error_with_validation_integration(self, mock_request): - """测试 API 调用错误时的集成流程""" - # 设置 mock 抛出异常 - from requests.exceptions import HTTPError - mock_response = mock.Mock() - mock_response.status_code = 404 - mock_response.headers = {"Content-Type": "application/json"} - mock_response.content = b"Not Found" - - http_error = HTTPError("404 Client Error") - http_error.response = mock_response - mock_request.side_effect = http_error - - # 创建 API 请求 - request = APIRequest( - method="GET", - url="https://api.example.com/wells/nonexistent", - headers={"Accept": "application/json"} - ) - - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用失败 - self.assertEqual(response.status_code, 404) - self.assertIsNone(response.json_content) - - # 尝试验证空数据 - validation_result = self.schema_validator.validate(response.json_content, self.well_schema) - - # 断言 - self.assertFalse(validation_result.is_valid) - # 数据为空或无效时应该有相应的错误消息 - self.assertTrue(len(validation_result.errors) > 0) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_comprehensive_integration.py b/tests/test_comprehensive_integration.py deleted file mode 100644 index cce7e59..0000000 --- a/tests/test_comprehensive_integration.py +++ /dev/null @@ -1,476 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -综合集成测试模块 - -该测试模块集成测试以下功能: -1. API 调用(模拟和实际) -2. JSON Schema 加载(从文件系统) -3. JSON Schema 验证(验证API响应) -4. 错误处理和边界条件 - -此测试依赖于运行中的模拟地震体API服务器(在端口5001上)。 -可以通过 `python -m tests.run_mock_seismic_api` 启动服务器。 -""" - -import os -import sys -import json -import unittest -import logging -import requests -from unittest import mock -from pathlib import Path - -# 添加项目根目录到Python路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -# 导入测试所需的模块 -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator -from ddms_compliance_suite.rule_repository.repository import RuleRepository -from ddms_compliance_suite.models.rule_models import RuleQuery, RuleCategory, TargetType -from ddms_compliance_suite.models.config_models import RuleRepositoryConfig, RuleStorageConfig - -# 配置日志 -logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') -logger = logging.getLogger(__name__) - -class TestComprehensiveIntegration(unittest.TestCase): - """综合集成测试类""" - - @classmethod - def setUpClass(cls): - """测试类初始化,检查模拟服务器是否运行""" - cls.mock_server_url = "http://localhost:5001" - try: - response = requests.get(cls.mock_server_url) #这里是测试服务器能否正常访问 - cls.server_running = True - logger.info(f"模拟API服务器可用,状态码: {response.status_code}") - except Exception as e: - cls.server_running = False - logger.warning(f"模拟API服务器不可用,请先启动服务器: {e}") - logger.warning("可以使用命令: python -m tests.run_mock_seismic_api") - raise unittest.SkipTest("模拟API服务器未运行") - - def setUp(self): - """每个测试前的初始化""" - # 初始化API调用器 - self.api_caller = APICaller( - default_timeout=5, - default_headers={"Content-Type": "application/json"} - ) - - # 初始化JSON Schema验证器 - self.schema_validator = JSONSchemaValidator() - - # 初始化规则仓库 - rule_config = RuleRepositoryConfig( - storage=RuleStorageConfig(path="./rules"), - preload_rules=True - ) - self.rule_repository = RuleRepository(rule_config) - - # 记录测试数据 - self.test_project_id = "testPrj1" - self.test_survey_id = "20230117135924_2" - self.sample_seismic_id = "20221113181927_1" # 服务器预置的样例地震体ID - - def test_1_load_schemas_from_repository(self): - """测试从规则仓库加载Schema""" - # 加载井数据Schema - well_schema_rule = self.rule_repository.get_rule("well-data-schema") - self.assertIsNotNone(well_schema_rule, "井数据Schema规则未找到") - self.assertEqual(well_schema_rule.category, RuleCategory.JSON_SCHEMA) - self.assertIsNotNone(well_schema_rule.schema_content, "井数据Schema内容为空") - logger.info("成功加载井数据Schema") - - # 加载地震体数据Schema - seismic_schema_rule = self.rule_repository.get_rule("seismic-data-schema") - self.assertIsNotNone(seismic_schema_rule, "地震体数据Schema规则未找到") - self.assertEqual(seismic_schema_rule.category, RuleCategory.JSON_SCHEMA) - self.assertIsNotNone(seismic_schema_rule.schema_content, "地震体数据Schema内容为空") - logger.info("成功加载地震体数据Schema") - - # 加载API响应Schema - api_schema_rule = self.rule_repository.get_rule("seismic-api-response-schema") - self.assertIsNotNone(api_schema_rule, "API响应Schema规则未找到") - self.assertEqual(api_schema_rule.category, RuleCategory.JSON_SCHEMA) - self.assertIsNotNone(api_schema_rule.schema_content, "API响应Schema内容为空") - logger.info("成功加载API响应Schema") - - # 确保规则查询功能正常工作 - schema_rules = self.rule_repository.query_rules(RuleQuery( - category=RuleCategory.JSON_SCHEMA, - is_enabled=True - )) - self.assertGreaterEqual(len(schema_rules), 3, "应至少有3个Schema规则") - logger.info(f"查询到 {len(schema_rules)} 个Schema规则") - - def test_2_validate_schemas_structure(self): - """测试验证已加载Schema的结构是否正确""" - # 验证井数据Schema结构 - well_schema_rule = self.rule_repository.get_rule("well-data-schema") - self.assertIn("properties", well_schema_rule.schema_content, "井数据Schema结构不正确") - self.assertIn("required", well_schema_rule.schema_content, "井数据Schema缺少required字段") - self.assertIn("wellName", well_schema_rule.schema_content["required"], "井数据Schema必填字段不正确") - logger.info("井数据Schema结构正确") - - # 验证地震体数据Schema结构 - seismic_schema_rule = self.rule_repository.get_rule("seismic-data-schema") - self.assertIn("properties", seismic_schema_rule.schema_content, "地震体数据Schema结构不正确") - self.assertIn("required", seismic_schema_rule.schema_content, "地震体数据Schema缺少required字段") - self.assertIn("projectId", seismic_schema_rule.schema_content["required"], "地震体数据Schema必填字段不正确") - logger.info("地震体数据Schema结构正确") - - # 验证API响应Schema结构 - api_schema_rule = self.rule_repository.get_rule("seismic-api-response-schema") - self.assertIn("properties", api_schema_rule.schema_content, "API响应Schema结构不正确") - self.assertIn("required", api_schema_rule.schema_content, "API响应Schema缺少required字段") - self.assertIn("code", api_schema_rule.schema_content["required"], "API响应Schema必填字段不正确") - logger.info("API响应Schema结构正确") - - def test_3_test_api_call_and_validate_response(self): - """测试API调用并验证响应""" - # 从规则仓库获取API响应Schema - api_schema_rule = self.rule_repository.get_rule("seismic-api-response-schema") - self.assertIsNotNone(api_schema_rule, "API响应Schema规则未找到") - api_response_schema = api_schema_rule.schema_content - - # 创建API请求:查询地震体道数 - request = APIRequest( - method="POST", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/traces/count", - json_data={ - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicId": self.sample_seismic_id - } - ) - - # 执行API调用 - response = self.api_caller.call_api(request) - - # 验证HTTP状态码 - self.assertEqual(response.status_code, 200, f"API调用失败,状态码: {response.status_code}") - logger.info(f"API调用成功,状态码: {response.status_code}") - - # 验证JSON响应格式 - self.assertIsNotNone(response.json_content, "API响应不是有效的JSON") - - # 使用修改后的更宽松的Schema验证API响应 - # 注意:不同的API端点可能有略微不同的响应格式 - # 为了测试的稳健性,我们这里做一些调整 - relaxed_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["code", "msg", "result"], # 放宽要求,不要求一定有flag字段 - "properties": { - "code": { - "type": ["string", "integer", "number"], - "description": "响应码,可以是字符串或数字" - }, - "flag": { - "type": "boolean", - "description": "操作是否成功的标志" - }, - "msg": { - "type": "string", - "description": "响应消息" - }, - "result": { - "description": "响应结果,可以是任意类型" - } - } - } - - validation_result = self.schema_validator.validate(response.json_content, relaxed_schema) - self.assertTrue(validation_result.is_valid, f"API响应验证失败: {validation_result.errors}") - logger.info("API响应验证成功") - - # 验证响应内容 - self.assertIn("result", response.json_content, "API响应缺少result字段") - logger.info(f"地震体 {self.sample_seismic_id} 的道数: {response.json_content.get('result')}") - - def test_4_create_new_seismic_and_validate(self): - """测试创建新地震体并验证""" - # 从规则仓库获取地震体数据Schema - seismic_schema_rule = self.rule_repository.get_rule("seismic-data-schema") - self.assertIsNotNone(seismic_schema_rule, "地震体数据Schema规则未找到") - seismic_schema = seismic_schema_rule.schema_content - - # 准备有效的地震体数据 - valid_seismic_data = { - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicName": "测试地震体-综合集成", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - # 首先验证地震体数据是否符合Schema - validation_result = self.schema_validator.validate(valid_seismic_data, seismic_schema) - self.assertTrue(validation_result.is_valid, f"地震体数据验证失败: {validation_result.errors}") - logger.info("地震体数据验证成功") - - # 创建API请求:添加地震体 - request = APIRequest( - method="POST", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/file/add", - json_data=valid_seismic_data - ) - - # 执行API调用 - response = self.api_caller.call_api(request) - - # 验证HTTP状态码 - self.assertEqual(response.status_code, 200, f"创建地震体API调用失败,状态码: {response.status_code}") - logger.info(f"创建地震体API调用成功,状态码: {response.status_code}") - - # 验证响应内容 - self.assertIsNotNone(response.json_content, "API响应不是有效的JSON") - self.assertIn("result", response.json_content, "API响应缺少result字段") - self.assertTrue(response.json_content.get("flag", False), "API操作标志为失败") - - # 获取创建的地震体ID - seismic_id = response.json_content.get("result") - self.assertIsNotNone(seismic_id, "未返回地震体ID") - logger.info(f"成功创建地震体,ID: {seismic_id}") - - # 现在测试查询新创建的地震体 - query_request = APIRequest( - method="POST", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/traces/count", - json_data={ - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicId": seismic_id - } - ) - - query_response = self.api_caller.call_api(query_request) - self.assertEqual(query_response.status_code, 200, f"查询地震体API调用失败,状态码: {query_response.status_code}") - self.assertIn("result", query_response.json_content, "查询API响应缺少result字段") - logger.info(f"新创建地震体 {seismic_id} 的道数: {query_response.json_content.get('result')}") - - def test_5_validate_invalid_data(self): - """测试验证无效数据""" - # 从规则仓库获取地震体数据Schema - seismic_schema_rule = self.rule_repository.get_rule("seismic-data-schema") - self.assertIsNotNone(seismic_schema_rule, "地震体数据Schema规则未找到") - seismic_schema = seismic_schema_rule.schema_content - - # 准备无效的地震体数据(缺少必填字段) - invalid_seismic_data = { - "projectId": self.test_project_id, - # 缺少 surveyId - "seismicName": "无效地震体-缺少字段", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - } - - # 验证无效数据应该失败 - validation_result = self.schema_validator.validate(invalid_seismic_data, seismic_schema) - self.assertFalse(validation_result.is_valid, "无效地震体数据验证应该失败") - self.assertTrue(any("surveyId" in error for error in validation_result.errors), - "验证错误应指出缺少surveyId字段") - logger.info(f"成功验证无效数据错误: {validation_result.errors}") - - # 准备另一种无效地震体数据(维度参数错误) - invalid_dimension_data = { - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicName": "无效地震体-维度参数错误", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 500, # 最小值大于最大值 - "serviceMax": 100, - "serviceSpan": 1 - } - ] - } - - # 验证无效维度参数,这种情况可能需要自定义验证,因为JSON Schema难以验证属性间的关系 - # 测试自定义维度验证逻辑 - def validate_dimensions(data): - errors = [] - if "dimensions" in data and isinstance(data["dimensions"], list): - for dim in data["dimensions"]: - min_val = dim.get("serviceMin") - max_val = dim.get("serviceMax") - if min_val is not None and max_val is not None: - if min_val > max_val: - errors.append(f"维度 {dim.get('dimensionName')} 的最小值({min_val})大于最大值({max_val})") - return errors - - # 运行自定义验证 - dimension_errors = validate_dimensions(invalid_dimension_data) - self.assertTrue(dimension_errors, "维度验证应检测到错误") - logger.info(f"成功验证维度参数错误: {dimension_errors}") - - def test_6_coordinate_conversion_integration(self): - """测试坐标转换API集成""" - # 准备坐标点 - coordinate_points = [ - [606406.1281141682, 6082083.338731234], - [609767.8725899048, 6080336.549935018], - [615271.9052119441, 6082017.422172886] - ] - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/coordinate/geodetic/toline", - json_data={ - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicId": self.sample_seismic_id, - "points": coordinate_points - } - ) - - # 执行API调用 - response = self.api_caller.call_api(request) - - # 验证HTTP状态码 - self.assertEqual(response.status_code, 200, f"坐标转换API调用失败,状态码: {response.status_code}") - logger.info(f"坐标转换API调用成功,状态码: {response.status_code}") - - # 验证响应内容 - self.assertIsNotNone(response.json_content, "API响应不是有效的JSON") - self.assertIn("result", response.json_content, "API响应缺少result字段") - - # 获取转换结果 - converted_points = response.json_content.get("result", []) - self.assertEqual(len(converted_points), len(coordinate_points), "转换结果点数量与输入不一致") - - # 打印转换结果 - for i, (coord, converted) in enumerate(zip(coordinate_points, converted_points)): - logger.info(f"坐标点 {i+1}: {coord} → 线点: {converted}") - - def test_7_export_task_integration(self): - """测试导出任务API集成""" - # 创建导出任务API请求 - submit_request = APIRequest( - method="POST", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/export/submit", - json_data={ - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicId": self.sample_seismic_id, - "saveDir": f"/export/{self.sample_seismic_id}.sgy" - } - ) - - # 执行API调用 - submit_response = self.api_caller.call_api(submit_request) - - # 验证HTTP状态码 - self.assertEqual(submit_response.status_code, 200, f"提交导出任务API调用失败,状态码: {submit_response.status_code}") - logger.info(f"提交导出任务API调用成功,状态码: {submit_response.status_code}") - - # 验证响应内容 - self.assertIsNotNone(submit_response.json_content, "API响应不是有效的JSON") - self.assertIn("result", submit_response.json_content, "API响应缺少result字段") - - # 获取任务ID - task_result = submit_response.json_content.get("result", {}) - self.assertIn("taskId", task_result, "任务结果缺少taskId字段") - task_id = task_result.get("taskId") - logger.info(f"导出任务ID: {task_id}") - - # 查询导出进度API请求 - progress_request = APIRequest( - method="GET", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/export/progress", - params={"taskId": task_id} - ) - - # 执行API调用 - progress_response = self.api_caller.call_api(progress_request) - - # 验证HTTP状态码 - self.assertEqual(progress_response.status_code, 200, f"查询导出进度API调用失败,状态码: {progress_response.status_code}") - logger.info(f"查询导出进度API调用成功,状态码: {progress_response.status_code}") - - # 验证响应内容 - self.assertIsNotNone(progress_response.json_content, "API响应不是有效的JSON") - self.assertIn("result", progress_response.json_content, "API响应缺少result字段") - - # 获取进度信息 - progress_result = progress_response.json_content.get("result", {}) - self.assertIn("status", progress_result, "进度结果缺少status字段") - self.assertIn("progress", progress_result, "进度结果缺少progress字段") - - status = progress_result.get("status") - progress = progress_result.get("progress") - logger.info(f"导出任务 {task_id} 状态: {status}, 进度: {progress}%") - - def test_8_h400_keywords_integration(self): - """测试获取H400关键字API集成""" - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{self.mock_server_url}/api/gsc/appmodel/api/v1/seismic/h400/keyword/list", - json_data={ - "projectId": self.test_project_id, - "surveyId": self.test_survey_id, - "seismicId": self.sample_seismic_id - } - ) - - # 执行API调用 - response = self.api_caller.call_api(request) - - # 验证HTTP状态码 - self.assertEqual(response.status_code, 200, f"获取H400关键字API调用失败,状态码: {response.status_code}") - logger.info(f"获取H400关键字API调用成功,状态码: {response.status_code}") - - # 验证响应内容 - self.assertIsNotNone(response.json_content, "API响应不是有效的JSON") - self.assertIn("result", response.json_content, "API响应缺少result字段") - - # 获取关键字列表 - keywords = response.json_content.get("result", []) - logger.info(f"地震体 {self.sample_seismic_id} 的H400关键字数量: {len(keywords)}") - - # 如果有关键字,打印第一个 - if keywords: - logger.info(f"第一个关键字: {keywords[0]}") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_generated_swagger_apis.py b/tests/test_generated_swagger_apis.py deleted file mode 100644 index 3f98999..0000000 --- a/tests/test_generated_swagger_apis.py +++ /dev/null @@ -1,10104 +0,0 @@ -import pytest -import requests -import json -import logging -import time -from typing import Dict, Any - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger('APITests') - - -# 辅助函数 -def format_response(response): - """美化响应输出""" - try: - return json.dumps(response.json(), indent=4, ensure_ascii=False) - except: - return response.text - - -def validate_response(response): - """验证API响应""" - assert response.status_code < 500, f"服务器错误: {response.status_code}" - - # 检查JSON响应 - try: - json_resp = response.json() - assert isinstance(json_resp, dict), "响应不是JSON对象" - except Exception as e: - # 非JSON响应也是可接受的 - logger.warning(f"响应不是JSON格式: {str(e)}") - pass - - -@pytest.mark.usefixtures('setup_api_test') -class TestGeneratedAPI: - """从API文档自动生成的API测试""" - - @pytest.fixture(scope='class') - def setup_api_test(self): - self.base_url = "http://localhost:8080" - self.session = requests.Session() - # 可以在这里添加认证逻辑 - # self.session.headers.update({'Authorization': 'Bearer YOUR_TOKEN'}) - yield - self.session.close() - - - def test_post_api_dms_dms_instance_code_v1_message_push_schema_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version} - 数据推送接口""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "XK56eDGEe2", - "schema": "wG9I7z0AYW", - "version": "cCjiERWFWc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/message/push/{path_params["schema}/{path_params["version}"]"]"]) - params = {} - headers = { - "tenant-id": "pbrrjlD32E", - "Authorization": "wxcbppT1v2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_geo_unit_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version} - 地质单元列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "y92x59JQVp", - "version": "HCPAyfSdJR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "eRClj1i8ap", - "Authorization": "WmfWUZquQ0", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_geo_unit(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_geo_unit - 地质单元数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_geo_unit") - - # 准备参数 - path_params = { - "dms_instance_code": "GJqFjEY65e" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit"]) - params = { - "id": "ktrXnpCia0" -} - headers = { - "tenant-id": "T6gwn10I41", - "Authorization": "Fc6T6g7WMt", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_geo_unit(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_geo_unit - 地质单元数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_geo_unit") - - # 准备参数 - path_params = { - "dms_instance_code": "7BGMA5ZeXP" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit"]) - params = { - "id": "Csm1pC8aKT" -} - headers = { - "tenant-id": "HpIGQsVrzo", - "Authorization": "ix1CIIOpN6", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_geo_unit(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit - 地质单元数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit") - - # 准备参数 - path_params = { - "dms_instance_code": "6sVYiPEpdb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit"]) - params = {} - headers = { - "tenant-id": "KNrV1FHmP1", - "Authorization": "H9RpP3tEQ7", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_geo_unit_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id} - 地质单元查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "rIQpEOkbU1", - "version": "SlZAHLle0o", - "id": "RcdHI8iG49" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "TfyDlWclEH", - "Authorization": "yzfumVHB7I", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dr_de_geology_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version} - 钻井地质设计列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Azul769utB", - "version": "ppj8JPC6CN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "TDKoCDBXxN", - "Authorization": "w94CreV7ad", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dr_de_geology(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dr_de_geology - 钻井地质设计数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dr_de_geology") - - # 准备参数 - path_params = { - "dms_instance_code": "WRkcOszktR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology"]) - params = { - "id": "68HB36GgMU" -} - headers = { - "tenant-id": "5CtrQFfz7X", - "Authorization": "ESwZaEw4IN", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dr_de_geology(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dr_de_geology - 钻井地质设计数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dr_de_geology") - - # 准备参数 - path_params = { - "dms_instance_code": "pcGrtp5cTx" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology"]) - params = { - "id": "Ri6JtWSbxq" -} - headers = { - "tenant-id": "9Uk6TspIow", - "Authorization": "aCD9ia9td8", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dr_de_geology(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology - 钻井地质设计数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology") - - # 准备参数 - path_params = { - "dms_instance_code": "F7JSaahAhS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology"]) - params = {} - headers = { - "tenant-id": "G8A8HUh6fr", - "Authorization": "bg8LMFOQvi", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dr_de_geology_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version}/{id} - 钻井地质设计查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RwNKPCtnob", - "version": "LfRh0HIrcK", - "id": "JchapdduwN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "PKv6cIKVgL", - "Authorization": "MmkKhizNC9", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_completion_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_completion/{version} - 井筒生产层段列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_completion/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "yUQ62OuwbW", - "version": "dUUMSjLE3B" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "9aI6hSL2wt", - "Authorization": "z12gHRuj7a", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_completion(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_completion - 井筒生产层段数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_completion") - - # 准备参数 - path_params = { - "dms_instance_code": "izHtR5ZG9X" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion"]) - params = { - "id": "Ckhq8gOYG5" -} - headers = { - "tenant-id": "PknRSkB01U", - "Authorization": "oo9EyJpeHA", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_completion(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_completion - 井筒生产层段数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_completion") - - # 准备参数 - path_params = { - "dms_instance_code": "5Wjx0XWeIU" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion"]) - params = { - "id": "JANTbzn0gk" -} - headers = { - "tenant-id": "P7X9GxAsfQ", - "Authorization": "8WTqBqxLz8", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_completion(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_completion - 井筒生产层段数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_completion") - - # 准备参数 - path_params = { - "dms_instance_code": "qLelsk8awn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion"]) - params = {} - headers = { - "tenant-id": "anizSG0jKV", - "Authorization": "ye47eBXysa", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_completion_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_completion/{version}/{id} - 井筒生产层段查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_completion/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "ITAamEudRP", - "version": "xFhtbUUcxl", - "id": "Divni79FR7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "GltvY1KBrZ", - "Authorization": "ZLbRpffSOP", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim - 压裂基础数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "t5qR9IhKKa" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim"]) - params = { - "id": "4IW1k9c85j" -} - headers = { - "tenant-id": "gR87R2373S", - "Authorization": "nEI4K3FIOZ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim - 压裂基础数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "L9vGXngfYQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim"]) - params = { - "id": "I8geqaNSoc" -} - headers = { - "tenant-id": "IbhfowWVWF", - "Authorization": "BReq7dfbPM", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim - 压裂基础数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "6pvsnySSek" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim"]) - params = {} - headers = { - "tenant-id": "NUMOHfi7gw", - "Authorization": "F3aFQY7XdQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version} - 压裂基础数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "WXAdAYbYPh", - "version": "q2mtk0qg8O" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "rTOCEuS5Bb", - "Authorization": "TvSqKP0inL", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version}/{id} - 压裂基础数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "aPzuvxGVbc", - "version": "cg7oCMnI3P", - "id": "wgmZ72CUXI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "IvTFAEu2tM", - "Authorization": "Kv4KyDqg5v", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version} - 压裂施工参数列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "789bmNqqal", - "version": "M8jGiuAcsP" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "JebJMeZ5KB", - "Authorization": "FPQyV1a9x9", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data - 压裂施工参数数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data") - - # 准备参数 - path_params = { - "dms_instance_code": "oPclcvCGYI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data"]) - params = { - "id": "IpD385cDEw" -} - headers = { - "tenant-id": "kkbhzxwGET", - "Authorization": "Aa0LDl4uQ2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data - 压裂施工参数数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data") - - # 准备参数 - path_params = { - "dms_instance_code": "3J69LF4UYe" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data"]) - params = { - "id": "zet9ftfZjz" -} - headers = { - "tenant-id": "yPzpNPZY52", - "Authorization": "zUedCbBxbV", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data - 压裂施工参数数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data") - - # 准备参数 - path_params = { - "dms_instance_code": "MAay82rR2Q" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data"]) - params = {} - headers = { - "tenant-id": "uxmKoC0ccS", - "Authorization": "YraqoSwKFt", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version}/{id} - 压裂施工参数查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "SfnnDoRxkl", - "version": "woIRQ1DLdQ", - "id": "a6VVIv9xWb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "b4GUOVsU4n", - "Authorization": "AdKgBF6BjF", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perf_interval_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version} - 射孔井段数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Qiy2Dbd2mY", - "version": "HGpbUeb0K3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "JW0S0yCoeO", - "Authorization": "85yPhrYQBM", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ach_perf_interval(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval - 射孔井段数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval") - - # 准备参数 - path_params = { - "dms_instance_code": "kx3DIcj1Ur" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval"]) - params = { - "id": "jaSjCwZcKr" -} - headers = { - "tenant-id": "oH9zDnxq0M", - "Authorization": "jsr1LBmSSO", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ach_perf_interval(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval - 射孔井段数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval") - - # 准备参数 - path_params = { - "dms_instance_code": "Oav3GxvpX3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval"]) - params = { - "id": "TgwIj7gDAw" -} - headers = { - "tenant-id": "QucrCAC4LI", - "Authorization": "KSHAgKtoiT", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perf_interval(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval - 射孔井段数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval") - - # 准备参数 - path_params = { - "dms_instance_code": "9zsfwrStBo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval"]) - params = {} - headers = { - "tenant-id": "tnOK7rWILa", - "Authorization": "fcJqDfTRmN", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ach_perf_interval_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version}/{id} - 射孔井段数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "iMKfUVcBOR", - "version": "fu1PZCV2oA", - "id": "SVDWX60gfs" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "R8u95aEXpy", - "Authorization": "C14WMN8IPx", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perforate(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate - 射孔井段数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate") - - # 准备参数 - path_params = { - "dms_instance_code": "b0B5n7V07N" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate"]) - params = {} - headers = { - "tenant-id": "peVKpnXvlA", - "Authorization": "NiuIEOTukd", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ach_perforate(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perforate - 射孔数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perforate") - - # 准备参数 - path_params = { - "dms_instance_code": "trnx9LwvVv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate"]) - params = { - "id": "oDYj1Uu0Xt" -} - headers = { - "tenant-id": "GZ75LEaQj1", - "Authorization": "5Qx4NtIxEr", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ach_perforate(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perforate - 射孔数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perforate") - - # 准备参数 - path_params = { - "dms_instance_code": "74EvVbqw3q" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate"]) - params = { - "id": "EtIBBrTtXb" -} - headers = { - "tenant-id": "HuzfhipzAX", - "Authorization": "1YE7fOdTvD", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perforate_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version} - 射孔数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "hPWXrlxchL", - "version": "NI1RbhWs6u" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "4bNgIMcian", - "Authorization": "XKeZVObwIn", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ach_perforate_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version}/{id} - 射孔数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "0mFms02FQb", - "version": "OcNH8G6Kd6", - "id": "t22PTPJ0ai" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "yGOtkWoK2o", - "Authorization": "dKzoP0qn66", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_string_list_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version} - 管柱元件列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "JZHbKvJkG0", - "version": "SezkVkp0FX" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "Ozy9pU6QsU", - "Authorization": "FTH4FuoMNX", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_string_list_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version}/{id} - 管柱元件查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "7JN899uRsm", - "version": "P2puOniHjO", - "id": "iTbWmFhnyC" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "AAAqINWDDC", - "Authorization": "UUKSweIaBX", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_string_list(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_string_list - 管柱元件数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_string_list") - - # 准备参数 - path_params = { - "dms_instance_code": "WM9w4Zx9bo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list"]) - params = { - "id": "T230TZpzR7" -} - headers = { - "tenant-id": "q7ABNxzmup", - "Authorization": "VY7NMnTqdv", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_string_list(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_string_list - 管柱元件数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_string_list") - - # 准备参数 - path_params = { - "dms_instance_code": "oOq70Z5Ca2" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list"]) - params = { - "id": "xL5gUP1xzv" -} - headers = { - "tenant-id": "QoDmA3UAYS", - "Authorization": "t5GiaAc9Z5", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_string_list(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list - 管柱元件数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list") - - # 准备参数 - path_params = { - "dms_instance_code": "xr8IrALT7P" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list"]) - params = {} - headers = { - "tenant-id": "nk3puNAdBK", - "Authorization": "WucKhT4mJh", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version} - 试油成果数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "UEOtr2OJnD", - "version": "tdawB5UNY8" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "AKkSiSpLOI", - "Authorization": "T1dAcaDSRx", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_test_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version}/{id} - 试油成果数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "fnK9VMg5ma", - "version": "NubMbtxWCL", - "id": "tL1B9VwyhA" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "sYDRrgEh48", - "Authorization": "GTGwHUVsf0", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test - 试油成果数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test") - - # 准备参数 - path_params = { - "dms_instance_code": "QFnptmlc4q" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test"]) - params = {} - headers = { - "tenant-id": "hqLdRPlT1W", - "Authorization": "evkjvBiXr0", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_test(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test - 试油成果数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test") - - # 准备参数 - path_params = { - "dms_instance_code": "rw2knT2MSH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test"]) - params = { - "id": "21JDvlEkp5" -} - headers = { - "tenant-id": "bBMLcN7HCD", - "Authorization": "gLDO9aWqUz", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_test(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test - 试油成果数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test") - - # 准备参数 - path_params = { - "dms_instance_code": "DHJQ7tjShD" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test"]) - params = { - "id": "23t2SpFyHa" -} - headers = { - "tenant-id": "Q5iR4zA69E", - "Authorization": "OKK6yhXJBh", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_test_daily_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version} - 试油日报列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "mu6M28rTPY", - "version": "ElUUb23mv0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "S0rxxPIYTo", - "Authorization": "KRNUEfrtoe", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_test_daily(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily - 试油日报数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "rMueRxQ6Up" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily"]) - params = { - "id": "t23lSJRhBm" -} - headers = { - "tenant-id": "PjpjgxyZ66", - "Authorization": "gCsD6xVKal", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_test_daily(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily - 试油日报数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "GpixDVmn8k" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily"]) - params = { - "id": "ZXUGuk09tM" -} - headers = { - "tenant-id": "08ajXwyGgd", - "Authorization": "M3dvPf3h2l", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_test_daily(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily - 试油日报数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "gzHwsOxj0L" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily"]) - params = {} - headers = { - "tenant-id": "Jj0l8OkQRX", - "Authorization": "Gq1Zu1z31a", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_test_daily_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version}/{id} - 试油日报查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RMSuDTZeBO", - "version": "sesHuufgfx", - "id": "nct0oOPolN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "Drh4vApO2N", - "Authorization": "pjfKQ3KvJu", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version} - 井泵注程序数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "e5LBQyVcf8", - "version": "NYgPVzM9XF" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "imvb6TUzrg", - "Authorization": "NLqeSX4qeI", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version}/{id} - 井泵注程序数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "CEaDep0iwy", - "version": "EtcaG8bcV9", - "id": "HTr5Qyr83z" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "Oya8zCwttm", - "Authorization": "g7ml20b1Ub", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject - 井泵注程序数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject") - - # 准备参数 - path_params = { - "dms_instance_code": "gA9yYDINTi" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject"]) - params = { - "id": "91sImme6hJ" -} - headers = { - "tenant-id": "tmKMHiAHov", - "Authorization": "tWjm17QdHy", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject - 井泵注程序数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject") - - # 准备参数 - path_params = { - "dms_instance_code": "aNunnNum8D" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject"]) - params = { - "id": "1BL2ULZug2" -} - headers = { - "tenant-id": "pCf0iwbEvf", - "Authorization": "0slZcQdcxP", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject - 井泵注程序数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject") - - # 准备参数 - path_params = { - "dms_instance_code": "SRDJoJa9VI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject"]) - params = {} - headers = { - "tenant-id": "F8lVQfQJ6v", - "Authorization": "egS8UN91jZ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_trip_connect_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data - 起下钻接单根数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data") - - # 准备参数 - path_params = { - "dms_instance_code": "qBt3bRI56X" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data"]) - params = { - "id": "xejLHo1BGd" -} - headers = { - "tenant-id": "Q85Xze8EEd", - "Authorization": "rD5JxD4cIT", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_trip_connect_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data - 起下钻接单根数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data") - - # 准备参数 - path_params = { - "dms_instance_code": "iNqlkVt3O0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data"]) - params = { - "id": "rfCjLcnQwg" -} - headers = { - "tenant-id": "dihwBrESU9", - "Authorization": "53ayuSGHDH", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_trip_connect_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data - 起下钻接单根数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data") - - # 准备参数 - path_params = { - "dms_instance_code": "ZYmIHCn3Z0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data"]) - params = {} - headers = { - "tenant-id": "PvaaUc9ooF", - "Authorization": "RC6qJGYbT9", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_trip_connect_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version} - 起下钻接单根数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "RCnRaqaERS", - "version": "Y0kmPIVBoQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "XBputwT3aH", - "Authorization": "z59tnTXOdH", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_trip_connect_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version}/{id} - 起下钻接单根查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "k8utWqxKiA", - "version": "SZqANxTGvI", - "id": "0F4oqmKfwk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "WNZznEwLlJ", - "Authorization": "yRjkghAOUG", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_show_stat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version} - 油气显示统计表列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "CLtjg4JnDu", - "version": "r1SNkgMrgR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "8Vc21s2on1", - "Authorization": "E8y4KxfNXo", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_rpt_show_stat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat - 油气显示统计表数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "6z2Su0KFoL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat"]) - params = { - "id": "qxyKPeq2i9" -} - headers = { - "tenant-id": "ZrKNdG1CBb", - "Authorization": "B7wCyCEh7V", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_rpt_show_stat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat - 油气显示统计表数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "QwXfqiOYNU" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat"]) - params = { - "id": "fj8Y2PuTfI" -} - headers = { - "tenant-id": "RsbOVCetKa", - "Authorization": "w1muCWGhEV", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_show_stat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat - 油气显示统计表数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "7Z6tuhU2Bt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat"]) - params = {} - headers = { - "tenant-id": "u049bE3qEP", - "Authorization": "RDrcETQClH", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_rpt_show_stat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version}/{id} - 油气显示统计表查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "HicduG72xX", - "version": "RNUEJbVz3F", - "id": "Wk1AJ4cthE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "JHckZRaEYQ", - "Authorization": "AnMV6OG8r9", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record - 录井综合记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record") - - # 准备参数 - path_params = { - "dms_instance_code": "dHLc6S3hli" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record"]) - params = {} - headers = { - "tenant-id": "9bPe6xR0Ky", - "Authorization": "Vssiti6Ayh", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record - 录井综合记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record") - - # 准备参数 - path_params = { - "dms_instance_code": "gTGv90aH5o" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record"]) - params = { - "id": "ujErjL26TS" -} - headers = { - "tenant-id": "mQFTVnI9Lr", - "Authorization": "JLgVhd19qj", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record - 录井综合记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record") - - # 准备参数 - path_params = { - "dms_instance_code": "Mnm36rRGsJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record"]) - params = { - "id": "CseVD4BOl1" -} - headers = { - "tenant-id": "kr1kIfHCS7", - "Authorization": "Hw90OUJglN", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version}/{id} - 录井综合记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "xmiLYqm1Ry", - "version": "McNdXc992b", - "id": "Qnd31OOxR5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "wjtJYJX4NZ", - "Authorization": "Wcqwt3kdOM", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version} - 录井综合记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "TNd5S5DzY1", - "version": "dmH8N45KfP" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "gsmDdActOt", - "Authorization": "xPflq4Tw9c", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_bas_test_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version} - 试油基础数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "DdW5uA1jHN", - "version": "JzsDHSjHEV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "xbItrVCu7H", - "Authorization": "vVVLtExA5K", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_bas_test_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version}/{id} - 试油基础数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RVnbjrBHx5", - "version": "hMQxFbYnzU", - "id": "mpzIS8UrPv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "9edr5ZF0yR", - "Authorization": "ZRTqYVvWK4", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_bas_test(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test - 试油基础数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test") - - # 准备参数 - path_params = { - "dms_instance_code": "VLeo6Nfxqm" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test"]) - params = {} - headers = { - "tenant-id": "Ma68TLyC2W", - "Authorization": "tHSEpO0A0p", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_bas_test(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_bas_test - 试油基础数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_bas_test") - - # 准备参数 - path_params = { - "dms_instance_code": "pIHIR49FLS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test"]) - params = { - "id": "Xt7VMXHtyz" -} - headers = { - "tenant-id": "NtZ6sIRRZd", - "Authorization": "aFwhYW1ulQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_bas_test(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_bas_test - 试油基础数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_bas_test") - - # 准备参数 - path_params = { - "dms_instance_code": "PXcaCM0Cxl" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test"]) - params = { - "id": "ppcKZVvONs" -} - headers = { - "tenant-id": "HrXQxDoVGj", - "Authorization": "AEPlWecYKb", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_query_dh_con_sum_oil_tube_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/query/dh_con_sum_oil_tube/{version} - 施工总结油管记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/query/dh_con_sum_oil_tube/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "eCqeiilcHS", - "version": "SOZjBbeUSL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/query/dh_con_sum_oil_tube/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "DGZjUcZEEi", - "Authorization": "XrBoSsAae2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube - 施工总结油管记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube") - - # 准备参数 - path_params = { - "dms_instance_code": "MTOWrhqBMw" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube"]) - params = { - "id": "j3YSCEkLsa" -} - headers = { - "tenant-id": "dief20ItjM", - "Authorization": "mTs3sFPZB4", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube - 施工总结油管记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube") - - # 准备参数 - path_params = { - "dms_instance_code": "zpNCPaSo1G" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube"]) - params = { - "id": "qokvm4Zyae" -} - headers = { - "tenant-id": "JARwZvyAQj", - "Authorization": "NpLqaru7QF", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube - 施工总结油管记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube") - - # 准备参数 - path_params = { - "dms_instance_code": "Cr9O4GvZjw" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube"]) - params = {} - headers = { - "tenant-id": "WdziTBHXTR", - "Authorization": "7bnhUUl7Bo", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube/{version}/{id} - 施工总结油管记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RznxMzESIS", - "version": "hR6abne4R0", - "id": "Fi2ituE6II" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "hY6FQGqfCs", - "Authorization": "uqOYehXd1n", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_query_dh_bas_layering_job_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/query/dh_bas_layering_job/{version} - 酸化压裂分层作业列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/query/dh_bas_layering_job/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "N7Ybgoo2Tz", - "version": "siLz38pqe9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/query/dh_bas_layering_job/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "t81jzkIKB9", - "Authorization": "nt3j4QoveJ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_bas_layering_job(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job - 酸化压裂分层作业数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job") - - # 准备参数 - path_params = { - "dms_instance_code": "0OXfD7PwPw" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job"]) - params = { - "id": "B4acwfjW97" -} - headers = { - "tenant-id": "LaptCVNJKk", - "Authorization": "ZFnXDUiqQz", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_bas_layering_job(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job - 酸化压裂分层作业数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job") - - # 准备参数 - path_params = { - "dms_instance_code": "6GWQJFJsXV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job"]) - params = { - "id": "C1AA1HF79k" -} - headers = { - "tenant-id": "PRAAWAMpkG", - "Authorization": "crUX0rXnOA", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_bas_layering_job(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job - 酸化压裂分层作业数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job") - - # 准备参数 - path_params = { - "dms_instance_code": "aIyVdQA5tW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job"]) - params = {} - headers = { - "tenant-id": "aaCJtykStf", - "Authorization": "Fbwc3gA9WK", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_bas_layering_job_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job/{version}/{id} - 酸化压裂分层作业查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "BRDjD1zYAb", - "version": "p9VlgwIygV", - "id": "SlbASYk1do" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "rZAoBvEOId", - "Authorization": "QfZxw11GnS", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_proppant_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version} - 支撑剂数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "ZB7gJXVOZC", - "version": "wDHGt92NGq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "v1AQLvgkhm", - "Authorization": "mLwTLyF6mq", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ach_proppant_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data - 支撑剂数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data") - - # 准备参数 - path_params = { - "dms_instance_code": "p2zie7Mg4D" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data"]) - params = { - "id": "rUFbDqhzBA" -} - headers = { - "tenant-id": "yXERNta4Jg", - "Authorization": "aoi1JlPmKt", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ach_proppant_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data - 支撑剂数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data") - - # 准备参数 - path_params = { - "dms_instance_code": "yFmPvq3LUf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data"]) - params = { - "id": "sR0Ix8JDxm" -} - headers = { - "tenant-id": "HXvgSXi3X5", - "Authorization": "KiEeJP7QXG", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_proppant_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data - 支撑剂数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data") - - # 准备参数 - path_params = { - "dms_instance_code": "a97uXF4CWP" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data"]) - params = {} - headers = { - "tenant-id": "MNUuZkHZOJ", - "Authorization": "7c3M7uUNK1", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ach_proppant_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version}/{id} - 支撑剂数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "MI9sZckHHm", - "version": "GZqXTDCZPx", - "id": "aEJ89QCIL9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "8w9evktTbo", - "Authorization": "9AImlgFkh9", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_dst_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version} - 地层测试列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "GkhT613Khs", - "version": "Vs5yOqfZvU" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "U2COeYACh3", - "Authorization": "X9S98AWWKV", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_dst(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_dst - 地层测试数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_dst") - - # 准备参数 - path_params = { - "dms_instance_code": "gmxyDtTFQ1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst"]) - params = { - "id": "cC72z0VCwU" -} - headers = { - "tenant-id": "QgvOwtD3eo", - "Authorization": "EzXNn26Oky", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_dst(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_dst - 地层测试数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_dst") - - # 准备参数 - path_params = { - "dms_instance_code": "JRbFK4pz0o" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst"]) - params = { - "id": "plbrUF9Un0" -} - headers = { - "tenant-id": "PBIaeIXi3n", - "Authorization": "weusf4jSMY", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_dst(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst - 地层测试数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst") - - # 准备参数 - path_params = { - "dms_instance_code": "76AFFvX8FI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst"]) - params = {} - headers = { - "tenant-id": "GJzvk1tsy9", - "Authorization": "RVjeya4Q9S", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_dst_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version}/{id} - 地层测试查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "LCalTXBRE5", - "version": "s0N3P8aHPm", - "id": "Yr6t9P9z3N" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "aVhtBuuzE5", - "Authorization": "pgFAQb58jN", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_water_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version} - 水分析列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Cyz3RzEuGv", - "version": "AZmZDZCPTl" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "Fzyu3kpVEN", - "Authorization": "ZG2iPv3zj2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_test_water(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_water - 水分析数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_water") - - # 准备参数 - path_params = { - "dms_instance_code": "6SkLvynFg7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water"]) - params = { - "id": "6pMEibkIoj" -} - headers = { - "tenant-id": "btS2NfmLIK", - "Authorization": "HvCVjSTrud", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_test_water(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_water - 水分析数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_water") - - # 准备参数 - path_params = { - "dms_instance_code": "pUghv3bSKb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water"]) - params = { - "id": "r5qxRUo5Gr" -} - headers = { - "tenant-id": "rGVplfrWFY", - "Authorization": "cGxGhUu8Sh", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_water(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water - 水分析数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water") - - # 准备参数 - path_params = { - "dms_instance_code": "9HQveluOrM" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water"]) - params = {} - headers = { - "tenant-id": "xq2cvBAm3V", - "Authorization": "VhiS4Pq95j", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_test_water_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version}/{id} - 水分析查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "nKY2zy0mcQ", - "version": "VcctrT2edf", - "id": "eSPHZPB4Oc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "RLYM7lQFqT", - "Authorization": "p44qm0CgK1", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version} - 测温测压数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "2ioGDkU3cl", - "version": "ZVjcYpKycx" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "fnljiUPADr", - "Authorization": "3sn9ukGlP9", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data - 测温测压数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data") - - # 准备参数 - path_params = { - "dms_instance_code": "OpprrPc6rK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data"]) - params = { - "id": "4yoZ3lDxpu" -} - headers = { - "tenant-id": "IWAndrc52t", - "Authorization": "VjLmM2Kf9I", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data - 测温测压数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data") - - # 准备参数 - path_params = { - "dms_instance_code": "KRdCKz77rt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data"]) - params = { - "id": "SFEvv3pKPj" -} - headers = { - "tenant-id": "NQv8bAwLzi", - "Authorization": "jCXrvXvbwz", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data - 测温测压数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data") - - # 准备参数 - path_params = { - "dms_instance_code": "WaAYNUxpc6" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data"]) - params = {} - headers = { - "tenant-id": "SFxeJ7fNjT", - "Authorization": "crvNlPJwBQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version}/{id} - 测温测压数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "h89VH4W455", - "version": "OQK5E90Mac", - "id": "qUsa8dF5Vo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "kPjR92W5p9", - "Authorization": "HnCcy4kNuP", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_farmation_test_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version} - 地层测试成果列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "uG7wou69Ue", - "version": "DuZY9LQNO0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "0haJYvyZ9x", - "Authorization": "beUHKv1Wzm", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_farmation_test(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test - 地层测试成果数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test") - - # 准备参数 - path_params = { - "dms_instance_code": "0tGvgUaK4V" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test"]) - params = {} - headers = { - "tenant-id": "Z4bpjOdoSu", - "Authorization": "FyCQQZsnYK", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_farmation_test(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test - 地层测试成果数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test") - - # 准备参数 - path_params = { - "dms_instance_code": "W06gDkFarR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test"]) - params = { - "id": "bvvKs55rra" -} - headers = { - "tenant-id": "dyNkWmOpgA", - "Authorization": "qvRMCU3w34", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_farmation_test(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test - 地层测试成果数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test") - - # 准备参数 - path_params = { - "dms_instance_code": "hgCdRI4hBX" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test"]) - params = { - "id": "QVWUkmVsmO" -} - headers = { - "tenant-id": "nsUe2tVV9k", - "Authorization": "fxRrb8gq4f", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_farmation_test_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version}/{id} - 地层测试成果查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "x6HWqSEwnJ", - "version": "QLPEtjZXvW", - "id": "Bbrbbw2vcn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "25m9wjAZHc", - "Authorization": "LbYwjrruzW", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_base_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version} - 试油成果统计数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "BB4pTWyg7T", - "version": "VUlfQsCPVn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "zxN1Lqj0LP", - "Authorization": "oBaEf1L3ve", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_test_base_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data - 试油成果统计数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data") - - # 准备参数 - path_params = { - "dms_instance_code": "3dyTvzPcka" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data"]) - params = { - "id": "f7Gxx9LDD8" -} - headers = { - "tenant-id": "trEoVMg8GC", - "Authorization": "WfOApNYLeK", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_test_base_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data - 试油成果统计数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data") - - # 准备参数 - path_params = { - "dms_instance_code": "q5uxacXsQ8" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data"]) - params = { - "id": "eIxPjn3Hlb" -} - headers = { - "tenant-id": "VT1UmBKD5t", - "Authorization": "Dq78mxwBhB", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_base_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data - 试油成果统计数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data") - - # 准备参数 - path_params = { - "dms_instance_code": "y7LhhzMYyH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data"]) - params = {} - headers = { - "tenant-id": "sQKjC1ND3X", - "Authorization": "5VxWvqxkXP", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_test_base_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version}/{id} - 试油成果统计数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "kxGaIYiYSZ", - "version": "PpP0U20JFq", - "id": "9VyS89kxCr" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "fQgj1xJP3Z", - "Authorization": "bRJCIVPwed", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version} - 测温测压列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "VuHVMcTcHf", - "version": "5zpJw63g32" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "BavJ5sJqg7", - "Authorization": "wwWSWa2FZe", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_pres_temp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp - 测温测压数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp") - - # 准备参数 - path_params = { - "dms_instance_code": "IBR8p9rnWx" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp"]) - params = { - "id": "kkqwWGjYdZ" -} - headers = { - "tenant-id": "5AkKqQnTZs", - "Authorization": "deBSlNgcvZ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_pres_temp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp - 测温测压数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp") - - # 准备参数 - path_params = { - "dms_instance_code": "tPb8yyj2rZ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp"]) - params = { - "id": "J6BfT5ybaz" -} - headers = { - "tenant-id": "0ZOsr3LLPS", - "Authorization": "KPaSA2qI9d", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp - 测温测压数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp") - - # 准备参数 - path_params = { - "dms_instance_code": "UMOWLxMdqQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp"]) - params = {} - headers = { - "tenant-id": "W4a056qE0L", - "Authorization": "5fxvSeMU6W", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_pres_temp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version}/{id} - 测温测压查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "HLXMz5g50p", - "version": "rhyAAa4O5E", - "id": "S5nzrJXJT4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "tpFhR8i4FM", - "Authorization": "5sDEiVxgrM", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version} - 排液求产动态数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "AI5ADuC593", - "version": "iIKM3Xp5AU" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "DdyCrmGV5H", - "Authorization": "iYx5zxeicP", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version}/{id} - 排液求产动态数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "sTcRN7uOg4", - "version": "rtRMkVTHXq", - "id": "QIfUUn5c65" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "XZ6OyzzD06", - "Authorization": "5pEfTGYKv8", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat - 排液求产动态数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "WvDbWRyTFj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat"]) - params = {} - headers = { - "tenant-id": "OOk9wpsbzd", - "Authorization": "lKpDinRYwS", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat - 排液求产动态数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "B9dHxm6yNO" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat"]) - params = { - "id": "EzdhJV2N1Z" -} - headers = { - "tenant-id": "2r0fMHF65a", - "Authorization": "a2Fd9WjUdR", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat - 排液求产动态数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "K4W7mETaIn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat"]) - params = { - "id": "9fpyDuXsnU" -} - headers = { - "tenant-id": "J867dMTesk", - "Authorization": "gHDfOTmsTk", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version} - 排液求产成果数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "0YAMDG1SnH", - "version": "dWj9srKiN7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "c7c15vodR9", - "Authorization": "PJRsgSTpUJ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat - 排液求产成果数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "WlNmHf7sJE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat"]) - params = {} - headers = { - "tenant-id": "U0jPJg8B5B", - "Authorization": "giXz1YwBIP", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat - 排液求产成果数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "v2Ba2rj0HS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat"]) - params = { - "id": "iueRnaCZMt" -} - headers = { - "tenant-id": "SybQjT5DP5", - "Authorization": "GYDCgQWPBX", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat - 排液求产成果数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "NYRQMrNFEW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat"]) - params = { - "id": "uRGcqdMLHI" -} - headers = { - "tenant-id": "MJj1pI7nJV", - "Authorization": "iOL4502AAj", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version}/{id} - 排液求产成果数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "ExaEgO3jZk", - "version": "t7iqU5FIUL", - "id": "k2gbB6g6NI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "W5teGlCjtn", - "Authorization": "cuhCy4DNMg", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_construction_summary_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version} - 施工总结列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "UmgHYKgWTX", - "version": "8roaXxPUj4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "hFTtL9RYMx", - "Authorization": "5xBAkEGJKe", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_construction_summary(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_construction_summary - 施工总结数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_construction_summary") - - # 准备参数 - path_params = { - "dms_instance_code": "twADB93ljb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary"]) - params = { - "id": "smtW0HIUu2" -} - headers = { - "tenant-id": "lfrXHKCbHF", - "Authorization": "9Pzv0mPPKT", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_construction_summary(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_construction_summary - 施工总结数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_construction_summary") - - # 准备参数 - path_params = { - "dms_instance_code": "G9wFWDUBIp" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary"]) - params = { - "id": "4vwjSDoRYk" -} - headers = { - "tenant-id": "J3k00180hl", - "Authorization": "hjkFiNokOU", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_construction_summary(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary - 施工总结数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary") - - # 准备参数 - path_params = { - "dms_instance_code": "kSvxUpEShi" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary"]) - params = {} - headers = { - "tenant-id": "GvUvtjwfAu", - "Authorization": "eeLGMPsYrU", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_construction_summary_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version}/{id} - 施工总结查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "9eqIDGnorD", - "version": "2cHPSKm8Ee", - "id": "5tv0CHc10G" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "bVc0Hm5VQ9", - "Authorization": "FWHfINCiVM", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_job_daily_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version} - 井下作业日报列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "YCp63veSBN", - "version": "SSIfwSqXNl" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "Dbg7XV9MQF", - "Authorization": "2yGaa3AwLz", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_job_daily(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily - 井下作业日报数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "0JaiDUxBxH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily"]) - params = { - "id": "GpTo4Mx6Dj" -} - headers = { - "tenant-id": "PWFJFE79N8", - "Authorization": "o9WBmWyasR", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_job_daily(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily - 井下作业日报数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "ftFHAmLCu5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily"]) - params = { - "id": "eOhqF07FvB" -} - headers = { - "tenant-id": "r5pyMR42MG", - "Authorization": "tCMsPCeqwb", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_job_daily(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily - 井下作业日报数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "2jHrNpzxbo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily"]) - params = {} - headers = { - "tenant-id": "c0iFFhY5gX", - "Authorization": "qF9cAfKCgQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_job_daily_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version}/{id} - 井下作业日报查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "x7egcOlEnT", - "version": "T7hTVFAgdM", - "id": "2e4KD4vEbu" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "ugsR2mLtsG", - "Authorization": "jSZY9aEMhQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_con_sum_management_info_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version} - 施工总结管理信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "3JmRIGs03H", - "version": "2PMosTIRY0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "V6poAt2twU", - "Authorization": "U0k4nFl4G8", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_con_sum_management_info(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info - 施工总结管理信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info") - - # 准备参数 - path_params = { - "dms_instance_code": "Uke9aUbLtn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info"]) - params = { - "id": "0iFr2vcZPH" -} - headers = { - "tenant-id": "kZkNh2zeRj", - "Authorization": "1mLIZUohFt", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_con_sum_management_info(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info - 施工总结管理信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info") - - # 准备参数 - path_params = { - "dms_instance_code": "HzwEwosCzr" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info"]) - params = { - "id": "FKtmoaDdMV" -} - headers = { - "tenant-id": "xGYW1lJG4Q", - "Authorization": "KgrMLuqF5u", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_con_sum_management_info(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info - 施工总结管理信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info") - - # 准备参数 - path_params = { - "dms_instance_code": "F8K1H3pQvt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info"]) - params = {} - headers = { - "tenant-id": "JlaYm1fczK", - "Authorization": "8kOaTGRmxv", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_con_sum_management_info_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version}/{id} - 施工总结管理信息查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "MrOx47N1zh", - "version": "1if49Rb2hE", - "id": "WKr4ru8DUS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "eKvsVNMXQe", - "Authorization": "b6gr8VPNq7", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version} - 井壁取心统计列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "jPloYd4iGe", - "version": "ypuep7l0nH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "mFELMxAeXQ", - "Authorization": "IEpgHuMqd8", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat - 井壁取心统计数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "yoG1dFZP8b" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat"]) - params = { - "id": "keGnIyjxQz" -} - headers = { - "tenant-id": "Bsn9nSkFZi", - "Authorization": "bhuw2gIz4r", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat - 井壁取心统计数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "Py8dDOR9JM" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat"]) - params = { - "id": "fmctb9zxoV" -} - headers = { - "tenant-id": "p8og4fopyZ", - "Authorization": "JXoCbDqiOP", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat - 井壁取心统计数据添加 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "jdI3FswnY3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat"]) - params = {} - headers = { - "tenant-id": "wcGO90dsqA", - "Authorization": "ACQ8hnHi89", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version}/{id} - 井壁取心统计查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "XQnVF1yFuf", - "version": "I9TscBlURK", - "id": "cEoy5jhX2d" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "STL2Qsbf6k", - "Authorization": "I4pFXjncaR", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_scan_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version} - 岩心图像扫描记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "iJCn3cF9LI", - "version": "n8Iav2hgs9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "HipnSx7OqW", - "Authorization": "KEAtnOUkll", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_core_scan(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan - 岩心图像扫描记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan") - - # 准备参数 - path_params = { - "dms_instance_code": "ESPfrFg7Vg" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan"]) - params = { - "id": "HTaQI5VQj7" -} - headers = { - "tenant-id": "nBrTUkBomo", - "Authorization": "AEzvclI3q3", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_core_scan(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan - 岩心图像扫描记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan") - - # 准备参数 - path_params = { - "dms_instance_code": "nacIpMGnjk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan"]) - params = { - "id": "k1GggidpdU" -} - headers = { - "tenant-id": "V5OHg4361s", - "Authorization": "BuXlCWoksR", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_scan(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan - 岩心图像扫描记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan") - - # 准备参数 - path_params = { - "dms_instance_code": "Zq6vY71jzO" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan"]) - params = {} - headers = { - "tenant-id": "gOsUCpy1xk", - "Authorization": "sLjizhVKRn", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_core_scan_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version}/{id} - 岩心图像扫描记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "0QFgZadw6d", - "version": "9UnGtLAvbq", - "id": "UviHjhCKj6" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "OuF9t57xf9", - "Authorization": "J22e7QAl2u", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version} - 气测迟到数据表列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "qOMGEaZv6z", - "version": "Fy5zG9AmGC" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "YzQqvnq8SP", - "Authorization": "evGaSrqojQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_gas_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data - 气测迟到数据表数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data") - - # 准备参数 - path_params = { - "dms_instance_code": "gOk6ARnRgm" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data"]) - params = { - "id": "xdd6SfrgoW" -} - headers = { - "tenant-id": "4nKZSltKeR", - "Authorization": "Fp9QaCLFWD", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_gas_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data - 气测迟到数据表数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data") - - # 准备参数 - path_params = { - "dms_instance_code": "tEXxB9Lj4c" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data"]) - params = { - "id": "3lYHzPruuo" -} - headers = { - "tenant-id": "AizKvyFTsi", - "Authorization": "NHNQ9i8hKj", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data - 气测迟到数据表数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data") - - # 准备参数 - path_params = { - "dms_instance_code": "pGeC2nu9Yf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data"]) - params = {} - headers = { - "tenant-id": "zo4HUpHGD4", - "Authorization": "xd85pdUgeD", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_gas_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version}/{id} - 气测迟到数据表查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RxqpSlsPQV", - "version": "iU1ycOTsco", - "id": "UlLDxv6UH1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "dA8Q3G1IOb", - "Authorization": "9PwXNTfMum", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_residual_carbon(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon - 残余碳分析记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon") - - # 准备参数 - path_params = { - "dms_instance_code": "mkOQFpm7A2" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon"]) - params = {} - headers = { - "tenant-id": "WmNTtKYRYW", - "Authorization": "QEQq3je2GU", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_residual_carbon(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon - 残余碳分析记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon") - - # 准备参数 - path_params = { - "dms_instance_code": "R0qtl1fiSn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon"]) - params = { - "id": "2DKjgheO1u" -} - headers = { - "tenant-id": "3udKxaV0DA", - "Authorization": "aA5N2Bx112", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_residual_carbon(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon - 残余碳分析记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon") - - # 准备参数 - path_params = { - "dms_instance_code": "yzNpBwm4Jo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon"]) - params = { - "id": "8FPtHzb3xn" -} - headers = { - "tenant-id": "9W7OPXlvdy", - "Authorization": "7JxW4ZV0L8", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_residual_carbon_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version}/{id} - 残余碳分析记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "ufdjlMfVDb", - "version": "k88X1ho0MW", - "id": "bZtlZVVsUO" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "g3PZ6ciXU9", - "Authorization": "WkncEc7nSZ", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_residual_carbon_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version} - 残余碳分析记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "4lTQuv2z2d", - "version": "961ofPThNu" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "PPpA2aJwHf", - "Authorization": "j0wMmTldJS", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version} - 井壁取心列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "KLPOZTwugp", - "version": "ktCxFr1i1D" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "gMBB5QgLUr", - "Authorization": "2FWz0AhtOy", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_sidewall_core(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core - 井壁取心数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core") - - # 准备参数 - path_params = { - "dms_instance_code": "esWuDWshMq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core"]) - params = { - "id": "Ql4kfpXLde" -} - headers = { - "tenant-id": "SS0avud3lM", - "Authorization": "2eddx1eGgg", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_sidewall_core(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core - 井壁取心数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core") - - # 准备参数 - path_params = { - "dms_instance_code": "fYJoIrSf9M" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core"]) - params = { - "id": "Inlchdu7Kk" -} - headers = { - "tenant-id": "7u6CBY58z8", - "Authorization": "WD6HddPOGq", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core - 井壁取心数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core") - - # 准备参数 - path_params = { - "dms_instance_code": "5FIiQkNUtV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core"]) - params = {} - headers = { - "tenant-id": "Wdc4crcG8B", - "Authorization": "gkL6Mw9K8U", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version}/{id} - 井壁取心查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "2jJJ8nGtwA", - "version": "vorDgq8vtN", - "id": "ntb36Rx11p" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "jUJbIArGgw", - "Authorization": "LbRSfzEzMN", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_gas(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_gas - 气测录井基础信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_gas") - - # 准备参数 - path_params = { - "dms_instance_code": "kqNkYHezYV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas"]) - params = { - "id": "nlq3AXNeFL" -} - headers = { - "tenant-id": "HSd5fSJU1B", - "Authorization": "bCwRtSJovN", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_gas(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_gas - 气测录井基础信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_gas") - - # 准备参数 - path_params = { - "dms_instance_code": "EUzo4xDl2z" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas"]) - params = { - "id": "CGxwzohXqw" -} - headers = { - "tenant-id": "L2YotsUPwj", - "Authorization": "k55vovi7g2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_gas(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas - 气测录井基础信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas") - - # 准备参数 - path_params = { - "dms_instance_code": "roJOttXyBQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas"]) - params = {} - headers = { - "tenant-id": "yeHrup4UJ8", - "Authorization": "oKNGYDMjXb", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_gas_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version} - 气测录井基础信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "W403j4cxp9", - "version": "fI9SJNgWRY" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "atSpAxpBkU", - "Authorization": "vbs9GooL8z", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_gas_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version}/{id} - 气测录井基础信息查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "uJnSVrSJSd", - "version": "rHR4Yig2qU", - "id": "27dYKCIZpa" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "H49HditVcB", - "Authorization": "os5ztGGpkg", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version}/{id} - 录井综合解释查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "QgJkk5UmOG", - "version": "LIND0cwxGw", - "id": "1M5gsUovt2" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "5xD56Y6sL4", - "Authorization": "SMt55XEROA", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp - 录井综合解释数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "JHPNe7obNA" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp"]) - params = {} - headers = { - "tenant-id": "ZuwSp8jXDw", - "Authorization": "ATtiBBy638", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp - 录井综合解释数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "zsAkEyoKeE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp"]) - params = { - "id": "yGlqgRwGDq" -} - headers = { - "tenant-id": "VKQTdfAWEl", - "Authorization": "TLopZsWNtx", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp - 录井综合解释数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "zwhlg6aAqY" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp"]) - params = { - "id": "mfeuUymZtg" -} - headers = { - "tenant-id": "KpQ1IXg3fD", - "Authorization": "jp5cMVb7Zp", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version} - 录井综合解释列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "euTpEsKwed", - "version": "aegHoCHtiN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "s2rDc4y328", - "Authorization": "Az49GSHoSB", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_logging_daily_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version} - 录井日报列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "oogtYvGwbr", - "version": "OU5Oi3Wawo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "m5iJPDhhiC", - "Authorization": "qhYTIEjLmC", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_rpt_logging_daily(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily - 录井日报数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "9ImFf6fNhN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily"]) - params = { - "id": "39Pg0kH0PJ" -} - headers = { - "tenant-id": "tqW8Bj1mqJ", - "Authorization": "D9X8yrbp0o", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_rpt_logging_daily(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily - 录井日报数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "zWQlVN44tx" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily"]) - params = { - "id": "vucFfYs5XB" -} - headers = { - "tenant-id": "0u6mNQzkQX", - "Authorization": "a1BSBvcdwG", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_logging_daily(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily - 录井日报数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "ISUDthpRNk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily"]) - params = {} - headers = { - "tenant-id": "rdirUtydOp", - "Authorization": "i6zk6w3SWx", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_rpt_logging_daily_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version}/{id} - 录井日报查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "wQL5fxmB0P", - "version": "cnNb2cFGfX", - "id": "8L7znvKX0u" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "w4MyGa7hZT", - "Authorization": "MNsZsZdckB", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version} - 酸化基础数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "HxJSQ09Ezl", - "version": "NhYCyD3kE4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "EYyeuPbRxF", - "Authorization": "2VC8ctlFs7", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim - 酸化基础数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "fXfvklhg6M" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim"]) - params = { - "id": "dkm8QOqhUc" -} - headers = { - "tenant-id": "riBpGV8D5f", - "Authorization": "trN4JhtZ1p", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim - 酸化基础数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "G8QMGHMn8X" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim"]) - params = { - "id": "cY7VcceeQ8" -} - headers = { - "tenant-id": "GUW4CkBNxC", - "Authorization": "aMJdGy59pa", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim - 酸化基础数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "TppZUvVay1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim"]) - params = {} - headers = { - "tenant-id": "yG8UUh6ymH", - "Authorization": "T4Autpq1iM", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version}/{id} - 酸化基础数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "m4dfGJn2aP", - "version": "tWd16sk2vV", - "id": "Xf12CIMruA" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "QqjSOAKZlb", - "Authorization": "QD1xq8r7El", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_cuttings_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version} - 岩屑描述记录列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "PL0TB9KdtH", - "version": "jbzQWumHgJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "lh92yMeSfu", - "Authorization": "yyj4lvIxEW", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_cuttings(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings - 岩屑描述记录数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings") - - # 准备参数 - path_params = { - "dms_instance_code": "Ua7Np8K3HG" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings"]) - params = { - "id": "hI4NGRN0I4" -} - headers = { - "tenant-id": "KwNGW9EdRv", - "Authorization": "nObkeO4P92", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_cuttings(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings - 岩屑描述记录数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings") - - # 准备参数 - path_params = { - "dms_instance_code": "wTwhJ44xRV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings"]) - params = { - "id": "li3NF7O7gU" -} - headers = { - "tenant-id": "NTDnrEppL0", - "Authorization": "PQ5rV5h7B0", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_cuttings(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings - 岩屑描述记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings") - - # 准备参数 - path_params = { - "dms_instance_code": "5qF0izph39" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings"]) - params = {} - headers = { - "tenant-id": "o7gIGwQ9Zf", - "Authorization": "Um9TTYAfhd", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_cuttings_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version}/{id} - 岩屑描述记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "erNzlLyOCp", - "version": "SzwHw47gtI", - "id": "IN3UD21Rln" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "H09GjOC0xO", - "Authorization": "phzRoQC3Iv", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version} - 录井解释成果表列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "zrsLPcuYp4", - "version": "YGVV4p75lv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "18Viwg7PFd", - "Authorization": "lNPUeYa6Fc", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp - 录井解释成果表数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "iL0EEgD66E" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp"]) - params = { - "id": "DVWcHvyaSZ" -} - headers = { - "tenant-id": "jtskRdlfFF", - "Authorization": "WGd63ZbIHL", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp - 录井解释成果表数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "U4uZ0qWwKe" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp"]) - params = { - "id": "BoikiZchI0" -} - headers = { - "tenant-id": "hdym8Rgpkn", - "Authorization": "Mr3KVODsGw", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp - 录井解释成果表数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "Sh1yirtnss" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp"]) - params = {} - headers = { - "tenant-id": "r1uRvoxEEQ", - "Authorization": "p7SyrtR16H", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version}/{id} - 录井解释成果表查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "qArp0jxwJU", - "version": "YYhKBY9tSg", - "id": "rwA8ZjGS8v" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "umal47CLaH", - "Authorization": "lJasz9hWRd", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_core_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version}/{id} - 钻井取心筒次数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "62uFjXsIOC", - "version": "wmedMa5GTK", - "id": "E1bxLt26tf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "jTHTHm4mtH", - "Authorization": "krkmccZCaq", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_core(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core - 钻井取心筒次数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core") - - # 准备参数 - path_params = { - "dms_instance_code": "78plqSSDW3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core"]) - params = { - "id": "OecdDjoH8x" -} - headers = { - "tenant-id": "fVRHx4sK7b", - "Authorization": "0ObpOOTMKT", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_core(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core - 钻井取心筒次数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core") - - # 准备参数 - path_params = { - "dms_instance_code": "3m6Zpbj6RQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core"]) - params = { - "id": "4Q8HFyIffc" -} - headers = { - "tenant-id": "Es0ygVICJu", - "Authorization": "6f9SH61FT5", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core - 钻井取心筒次数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core") - - # 准备参数 - path_params = { - "dms_instance_code": "lotDnCPeAA" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core"]) - params = {} - headers = { - "tenant-id": "f86C1xmBae", - "Authorization": "uOr3U6hcFF", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version} - 钻井取心筒次数据列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "3DBoGHjGJr", - "version": "uOgXnSW4YQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "v7Fe4KeXuw", - "Authorization": "BKrTtyBRi1", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_desc_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version} - 钻井取心描述记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "aPn8NMrRU1", - "version": "dNWpy9VMWk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "jjTul91lA1", - "Authorization": "gSW6LenmBY", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_core_desc(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc - 钻井取心描述记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "HlnNSfTvPY" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc"]) - params = { - "id": "qRc9bxQYsA" -} - headers = { - "tenant-id": "Ld6ZZWESTs", - "Authorization": "12v1SjPiTZ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_core_desc(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc - 钻井取心描述记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "y853NnR3zx" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc"]) - params = { - "id": "tbqeOKZiga" -} - headers = { - "tenant-id": "rpGSTyAv4g", - "Authorization": "rB0rQAqyz1", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_desc(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc - 钻井取心描述记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "exFzIaWf2H" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc"]) - params = {} - headers = { - "tenant-id": "9kMb6yOX1v", - "Authorization": "ILjL0QaQH7", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_core_desc_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version}/{id} - 钻井取心描述记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "kTu199FpXZ", - "version": "mzP7GIdm1G", - "id": "YaKFMRLq2B" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "IaHGuXHJVB", - "Authorization": "oPqdIjza2s", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version} - 气测解释成果列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "4h48ayEKE4", - "version": "WkPaVE7vXc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "nnp4VKEgYT", - "Authorization": "YpHDfe7WeX", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_gas_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp - 气测解释成果数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "FevBuRQj4L" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp"]) - params = { - "id": "aQNbm3baGW" -} - headers = { - "tenant-id": "NoSeF6isZf", - "Authorization": "XAR5xFdxc5", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_gas_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp - 气测解释成果数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "ruu1Sq2kDl" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp"]) - params = { - "id": "QSKpDDlS0D" -} - headers = { - "tenant-id": "wylpVhTsLd", - "Authorization": "nQO3mnMbzv", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp - 气测解释成果数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "hqKbYx4HzK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp"]) - params = {} - headers = { - "tenant-id": "wxvjJJwi0y", - "Authorization": "9qi1t1BFnH", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_gas_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version}/{id} - 气测解释成果查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "SIM7lOT41P", - "version": "7d5XxUuciS", - "id": "w1PUSqtfCZ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "VIDPsPQuKS", - "Authorization": "eYSTRsxEGN", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version} - 取心描述列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "5Qzmx9HGph", - "version": "H1kHRZI5vn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "C7vJQznjBW", - "Authorization": "NdyF72GU0W", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc - 取心描述数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "YPmdh8gAQY" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc"]) - params = { - "id": "2xwNGkGjla" -} - headers = { - "tenant-id": "lN5pVgU0k7", - "Authorization": "s2TLmnjNV5", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc - 取心描述数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "x2UvBsS44T" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc"]) - params = { - "id": "clndtUxfLT" -} - headers = { - "tenant-id": "7DhnLlZNY1", - "Authorization": "DJoFZXzJPz", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc - 取心描述数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "UfHxFCMn8w" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc"]) - params = {} - headers = { - "tenant-id": "pWvywyoZLn", - "Authorization": "VozbVY3f8z", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version}/{id} - 取心描述查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "3mRAE7ObLm", - "version": "5adoP584dz", - "id": "GDy5M8cafH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "yNBnbQy3cd", - "Authorization": "H3cW9oasBZ", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_sealing_core_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version} - 钻井取心列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "qucpO336qt", - "version": "kuJzarItZ9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "8EJkhQ2CiO", - "Authorization": "OO2Qa0KmIo", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_sealing_core(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core - 钻井取心数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core") - - # 准备参数 - path_params = { - "dms_instance_code": "Bv9Vwhkqtv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core"]) - params = { - "id": "MyYsfvvkfi" -} - headers = { - "tenant-id": "JpWGN9W2Oh", - "Authorization": "4ZjDxmvnOj", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_sealing_core(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core - 钻井取心数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core") - - # 准备参数 - path_params = { - "dms_instance_code": "Dq22bj8nUj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core"]) - params = { - "id": "SCYdf32HRp" -} - headers = { - "tenant-id": "GphZ0N6Cbf", - "Authorization": "RpT9Tex1zi", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_sealing_core(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core - 钻井取心数据添加 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core") - - # 准备参数 - path_params = { - "dms_instance_code": "XvSO01bC3y" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core"]) - params = {} - headers = { - "tenant-id": "mSm2ofOq3n", - "Authorization": "Rm8cBRzQoQ", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_sealing_core_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version}/{id} - 钻井取心查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "We7i1X4ZZz", - "version": "6vDFyIGwEY", - "id": "w05WfAElxV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "hhZ55ZnYDH", - "Authorization": "ICRJzZUS99", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version} - 单井地质分层列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Kt61oSKpfu", - "version": "K5GrMuf15r" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "RcE3zki5h0", - "Authorization": "Ld2J9mTI66", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme - 单井地质分层数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme") - - # 准备参数 - path_params = { - "dms_instance_code": "cnFQQDKwLR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme"]) - params = { - "id": "PG2ICDg8qK" -} - headers = { - "tenant-id": "gfA7hOZtQY", - "Authorization": "eps2fWZCzz", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme - 单井地质分层数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme") - - # 准备参数 - path_params = { - "dms_instance_code": "ETz4n3EBtH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme"]) - params = { - "id": "tPdOvos2jP" -} - headers = { - "tenant-id": "fkDX8sN04e", - "Authorization": "zXiyZpYoyI", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme - 单井地质分层数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme") - - # 准备参数 - path_params = { - "dms_instance_code": "5kQEgS6rRF" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme"]) - params = {} - headers = { - "tenant-id": "vGpKAF4HLQ", - "Authorization": "RHmCwGCYdN", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version}/{id} - 单井地质分层查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "xjPoVPReEz", - "version": "mTA2yfEjMY", - "id": "vXBOdbKX71" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "OuhDYOOnIv", - "Authorization": "CrYbuzn0G6", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum - 地质分层数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum") - - # 准备参数 - path_params = { - "dms_instance_code": "9vBpgEkdwN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum"]) - params = { - "id": "SjwZAlZ0FT" -} - headers = { - "tenant-id": "8njGaXb2mF", - "Authorization": "IF3VxFXuak", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum - 地质分层数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum") - - # 准备参数 - path_params = { - "dms_instance_code": "PY2CMDWDqc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum"]) - params = { - "id": "ZY6GgSzOp8" -} - headers = { - "tenant-id": "pMGDb7lqIj", - "Authorization": "pb7ZPzaiFc", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum - 地质分层数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum") - - # 准备参数 - path_params = { - "dms_instance_code": "IBYrCcD7q4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum"]) - params = {} - headers = { - "tenant-id": "2g8jpu11zR", - "Authorization": "z458meX1HI", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version} - 地质分层数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "jXch3R7UGZ", - "version": "IARAnMtKFE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "J7fHxQ5NHD", - "Authorization": "xKVc2htxVs", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version}/{id} - 地质分层数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "72Rhr2n23y", - "version": "FmImQM9mf0", - "id": "Bx8wXdzSpf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "AXgtzEXYG1", - "Authorization": "H9fLWjekmc", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_well_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_well/{version} - 井基本信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_well/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "uNAPxPT3o3", - "version": "N8a5yhrjT9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "NA37MpEAJp", - "Authorization": "LoktIZotK7", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_well(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_well - 井基本信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_well") - - # 准备参数 - path_params = { - "dms_instance_code": "TeJLsJfyrs" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well"]) - params = { - "id": "uxOYtYiQhY" -} - headers = { - "tenant-id": "jPbYu3euKu", - "Authorization": "E4OcYrPRXq", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_well(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_well - 井基本信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_well") - - # 准备参数 - path_params = { - "dms_instance_code": "b2ceXIIbJF" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well"]) - params = { - "id": "1R201LiGDb" -} - headers = { - "tenant-id": "MeHAOUMayC", - "Authorization": "y2Be52C4iF", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_well(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_well - 井基本信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_well") - - # 准备参数 - path_params = { - "dms_instance_code": "DXGvaQgceZ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well"]) - params = {} - headers = { - "tenant-id": "alrF2RpsEN", - "Authorization": "9MeT7WSXyF", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_well_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_well/{version}/{id} - 井基本信息查询详情-dsid""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_well/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "8NI5LiPHXz", - "version": "8XY014OxfT", - "id": "8taRFUtVxe" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "gR2pz0OGo2", - "Authorization": "3yhz7OLm0V", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_masterdata_cd_well_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/masterdata/cd_well/{version}/{id} - 基本信息查询详情-井ID""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/masterdata/cd_well/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "QsUYepg4IX", - "version": "cJqRkF1e5v", - "id": "j1TxE0XGOn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/masterdata/cd_well/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "HAR3aRF91b", - "Authorization": "4DRgOhU83b", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_naturalkey_cd_well_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/naturalkey/cd_well/{version} - 通过业务主键获取数据详情""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/naturalkey/cd_well/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "3WLZS2r1YI", - "version": "UGXRCA09Wc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/naturalkey/cd_well/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "hgMJnrzJJH", - "Authorization": "stBWQczPF4", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_event_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_event/{version} - 井作业阶段信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_event/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "cGJDsTdXvY", - "version": "KSubo9ub1h" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "eSnQq6EuPN", - "Authorization": "yELDsPIOBy", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_event_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_event/{version}/{id} - 井作业阶段查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_event/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "WcHlCzWjAa", - "version": "vCSDayWGdV", - "id": "h2Gfws7GSw" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "KXOwmZarzL", - "Authorization": "mtfFMUn5EH", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_event(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_event - 井作业阶段数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_event") - - # 准备参数 - path_params = { - "dms_instance_code": "SaMEvy6RtL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event"]) - params = { - "id": "Zv6orSeKoE" -} - headers = { - "tenant-id": "zBxxczkrUT", - "Authorization": "QtChHB5LhP", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_event(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_event - 井作业阶段数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_event") - - # 准备参数 - path_params = { - "dms_instance_code": "T9NNpZI0xM" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event"]) - params = { - "id": "shzmIB1iYw" -} - headers = { - "tenant-id": "PEsWzJPVME", - "Authorization": "wG4frzlAK5", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_event(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_event - 井作业阶段数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_event") - - # 准备参数 - path_params = { - "dms_instance_code": "uaW8ny0iix" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event"]) - params = {} - headers = { - "tenant-id": "EE1ld1yOYY", - "Authorization": "SehAwZ5sqH", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_organization(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_organization - 组织机构数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_organization") - - # 准备参数 - path_params = { - "dms_instance_code": "ovibF16sKd" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization"]) - params = {} - headers = { - "tenant-id": "0sv7H55In3", - "Authorization": "Haiil5qycS", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_organization(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_organization - 组织机构数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_organization") - - # 准备参数 - path_params = { - "dms_instance_code": "7qHSqkOL0y" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization"]) - params = { - "id": "sg3cK5Omhn" -} - headers = { - "tenant-id": "F8y95owjU2", - "Authorization": "kogixcPau4", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_organization(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_organization - 组织机构数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_organization") - - # 准备参数 - path_params = { - "dms_instance_code": "8fmKdNL19R" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization"]) - params = { - "id": "bKvOZ4UqF1" -} - headers = { - "tenant-id": "q0DdeNIqTe", - "Authorization": "Tokg3Rnnew", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_organization_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_organization/{version}/{id} - 组织机构查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_organization/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "KB36jhmELD", - "version": "bsq52LCAOR", - "id": "1wdj8uegGB" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "RRTsjlUY7M", - "Authorization": "vIDKb66bF9", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_organization_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_organization/{version} - 组织机构信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_organization/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "7rDN6Cisio", - "version": "E5xPyHvJnt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "pvWzIdBbKW", - "Authorization": "M2nm1XPOv2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_wellbore_zone_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version} - 小层分层数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "80qJ7TWlSv", - "version": "Xbczxpxrri" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore_zone/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "HWnK1hgiun", - "Authorization": "Q3FQiJs1nN", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_wellbore_zone_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version}/{id} - 小层分层数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "DfrDNRuL91", - "version": "x1hwk0TKUV", - "id": "IM2MiwhTsy" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore_zone/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "rwOD0KMpKG", - "Authorization": "ibpKBfJE5P", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_instance_code_v1_cd_wellbore_zone(self): - """测试 [POST] /api/{dms_instance_code}/v1/cd_wellbore_zone - 小层分层数据添加""" - logger.info(f"测试API: [POST] /api/{dms_instance_code}/v1/cd_wellbore_zone") - - # 准备参数 - path_params = { - "dms_instance_code": "niAS93slKb" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/cd_wellbore_zone"]) - params = {} - headers = { - "tenant-id": "Kvv4up2vkh", - "Authorization": "GxjrpmDm0f", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_instance_code_v1_cd_wellbore_zone(self): - """测试 [PUT] /api/{dms_instance_code}/v1/cd_wellbore_zone - 小层分层数据修改""" - logger.info(f"测试API: [PUT] /api/{dms_instance_code}/v1/cd_wellbore_zone") - - # 准备参数 - path_params = { - "dms_instance_code": "acSAbmLk1S" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/cd_wellbore_zone"]) - params = {} - headers = { - "tenant-id": "birA0BYBWh", - "Authorization": "t111VrooJI", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_instance_code_v1_cd_wellbore_zone(self): - """测试 [DELETE] /api/{dms_instance_code}/v1/cd_wellbore_zone - 小层分层数据删除""" - logger.info(f"测试API: [DELETE] /api/{dms_instance_code}/v1/cd_wellbore_zone") - - # 准备参数 - path_params = { - "dms_instance_code": "pDOAJRW9O0" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/cd_wellbore_zone"]) - params = {} - headers = { - "tenant-id": "IzbLT57Yci", - "Authorization": "MyX6E6cG1M", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_hp_mat_smpl_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version} - 高压物性取样列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "txRWxGt6ga", - "version": "1h4Jeo0mXH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "O8Xdc17ihy", - "Authorization": "ciq69VsIye", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_instance_code_v1_tp_ops_hp_mat_smpl(self): - """测试 [PUT] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl - 高压物性取样数据修改""" - logger.info(f"测试API: [PUT] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl") - - # 准备参数 - path_params = { - "dms_instance_code": "4fnBcEKjAk" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl"]) - params = {} - headers = { - "tenant-id": "pDj7D3cxRh", - "Authorization": "FVZTUoyE5b", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_instance_code_v1_tp_ops_hp_mat_smpl(self): - """测试 [DELETE] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl - 高压物性取样数据删除""" - logger.info(f"测试API: [DELETE] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl") - - # 准备参数 - path_params = { - "dms_instance_code": "fOTRmcdHvZ" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl"]) - params = {} - headers = { - "tenant-id": "PBbrsaBAJZ", - "Authorization": "wRpWNNLj7n", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_instance_code_v1_tp_ops_hp_mat_smpl(self): - """测试 [POST] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl - 高压物性取样数据添加""" - logger.info(f"测试API: [POST] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl") - - # 准备参数 - path_params = { - "dms_instance_code": "nrORr1C9WJ" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl"]) - params = {} - headers = { - "tenant-id": "0Z9HetLZyP", - "Authorization": "4CxhzdiOqD", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ops_hp_mat_smpl_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version}/{id} - 高压物性取样查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "bGu4S0FjE5", - "version": "5jxVwzfnZu", - "id": "GoeOIH48vk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "v8qd14ZgFM", - "Authorization": "Hia2TzcV4l", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version} - 储集岩热解解释成果数据列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "ukI3C6RpTH", - "version": "0JjHBk3YLc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "Y8O5fEIZvw", - "Authorization": "D7C0qD42BA", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp - 储集岩热解解释成果数据数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "HYxuH65bIY" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp"]) - params = { - "id": "IbQ1LMIe4o" -} - headers = { - "tenant-id": "r8joY7Cxv9", - "Authorization": "zOBOwp0IUv", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp - 储集岩热解解释成果数据数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "SuqbmYGqpo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp"]) - params = { - "id": "sDUMO8UqkH" -} - headers = { - "tenant-id": "4IWpJvQD4m", - "Authorization": "nvGSEuE3py", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp - 储集岩热解解释成果数据数据添加 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "KaWsY2B5Iq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp"]) - params = {} - headers = { - "tenant-id": "fFJ0x9yqlU", - "Authorization": "aG82aQwt2l", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version}/{id} - 储集岩热解解释成果数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "njvVR5O66p", - "version": "yLfOh9VLEw", - "id": "Miuzn6ZQsd" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "cDeztsDoYB", - "Authorization": "6GtbzrAxBg", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_wellbore_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version} - 井筒基本信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "UqxwXWdAHl", - "version": "7zEelcfHh2" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "pKdffP5PNv", - "Authorization": "x670Lnw353", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_wellbore(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_wellbore - 井筒基本信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_wellbore") - - # 准备参数 - path_params = { - "dms_instance_code": "0i0TM2B2Rg" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore"]) - params = { - "id": "EAa7mZk7FN" -} - headers = { - "tenant-id": "4rYaaqXgj9", - "Authorization": "I6lsdWBpw3", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_wellbore(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_wellbore - 井筒基本信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_wellbore") - - # 准备参数 - path_params = { - "dms_instance_code": "hcZptqLuKJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore"]) - params = { - "id": "HG2955rzS9" -} - headers = { - "tenant-id": "4zOwOaNjJj", - "Authorization": "VpuNM4JI4M", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_wellbore(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore - 井筒基本信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore") - - # 准备参数 - path_params = { - "dms_instance_code": "ych2dSZybe" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore"]) - params = {} - headers = { - "tenant-id": "GMxpfbsyiQ", - "Authorization": "fcnqacHcG5", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_wellbore_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version}/{id} - 井筒基本信息查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "QVKoqx1fXZ", - "version": "UQI35BhF3e", - "id": "Io8R9KzboE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "5nsbdRuUSh", - "Authorization": "hHYL0sjGHe", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_hp_mat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version} - 高压物性分析列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "z2yfDDPwxY", - "version": "HtlYRuahcu" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_hp_mat/{path_params["version}"]"]) - params = {} - headers = { - "tenant-id": "Gs2iu6Lhdi", - "Authorization": "azQUl9kk1p", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_instance_code_v1_tp_ach_hp_mat(self): - """测试 [PUT] /api/{dms_instance_code}/v1/tp_ach_hp_mat - 高压物性分析数据修改""" - logger.info(f"测试API: [PUT] /api/{dms_instance_code}/v1/tp_ach_hp_mat") - - # 准备参数 - path_params = { - "dms_instance_code": "Cy5dvQAFuY" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ach_hp_mat"]) - params = {} - headers = { - "tenant-id": "6iIgA9uvn0", - "Authorization": "wDmaqUZ4oe", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_instance_code_v1_tp_ach_hp_mat(self): - """测试 [DELETE] /api/{dms_instance_code}/v1/tp_ach_hp_mat - 高压物性分析数据删除""" - logger.info(f"测试API: [DELETE] /api/{dms_instance_code}/v1/tp_ach_hp_mat") - - # 准备参数 - path_params = { - "dms_instance_code": "Cvpje588pL" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ach_hp_mat"]) - params = {} - headers = { - "tenant-id": "eywGBZz9Wg", - "Authorization": "tXDL84PORb", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_instance_code_v1_tp_ach_hp_mat(self): - """测试 [POST] /api/{dms_instance_code}/v1/tp_ach_hp_mat - 高压物性分析数据添加""" - logger.info(f"测试API: [POST] /api/{dms_instance_code}/v1/tp_ach_hp_mat") - - # 准备参数 - path_params = { - "dms_instance_code": "ezFVErHcys" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ach_hp_mat"]) - params = {} - headers = { - "tenant-id": "1YuPXw255G", - "Authorization": "0vRLM5S9k2", - "Content-Type": "application/json", - "Accept": "application/json" -} - body = { - "message": "This is a test request" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_hp_mat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version}/{id} - 高压物性分析查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "mlJThZyJyP", - "version": "ry8kEmolG5", - "id": "oC2oQTC0MR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_hp_mat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "tenant-id": "qDoj2zx5Wr", - "Authorization": "FPnVdc2zff", - "Content-Type": "application/json", - "Accept": "application/json" -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - diff --git a/tests/test_generated_yapi_apis.py b/tests/test_generated_yapi_apis.py deleted file mode 100644 index e8d8921..0000000 --- a/tests/test_generated_yapi_apis.py +++ /dev/null @@ -1,11318 +0,0 @@ -import pytest -import requests -import json -import logging -import time -from typing import Dict, Any - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger('APITests') - - -# 辅助函数 -def format_response(response): - """美化响应输出""" - try: - return json.dumps(response.json(), indent=4, ensure_ascii=False) - except: - return response.text - - -def validate_response(response): - """验证API响应""" - assert response.status_code < 500, f"服务器错误: {response.status_code}" - - # 检查JSON响应 - try: - json_resp = response.json() - assert isinstance(json_resp, dict), "响应不是JSON对象" - except Exception as e: - # 非JSON响应也是可接受的 - logger.warning(f"响应不是JSON格式: {str(e)}") - pass - - -@pytest.mark.usefixtures('setup_api_test') -class TestGeneratedAPI: - """从API文档自动生成的API测试""" - - @pytest.fixture(scope='class') - def setup_api_test(self): - self.base_url = "http://localhost:8080" - self.session = requests.Session() - # 可以在这里添加认证逻辑 - # self.session.headers.update({'Authorization': 'Bearer YOUR_TOKEN'}) - yield - self.session.close() - - - def test_post_api_dms_dms_instance_code_v1_message_push_schema_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version} - 数据推送接口""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/message/push/{schema}/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "3dPlz4vcAR", - "schema": "YtdnNtQzIS", - "version": "7joaiBot5n" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/message/push/{path_params["schema}/{path_params["version}"]"]"]) - params = {} - headers = { - "Content-Type": "w6FBwZ0d3E", - "Accept": "application/json", - "tenant-id": "KWx7QL46Fz", - "Authorization": "uz3EaMyeKL" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 18 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_geo_unit_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version} - 地质单元列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "KXOxNJJOyX", - "version": "7emvTYhBWn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "TJXJsk4wAC", - "Accept": "application/json", - "tenant-id": "GkeNwchP6A", - "Authorization": "w8BEZUwjq2" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 57 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_geo_unit(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_geo_unit - 地质单元数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_geo_unit") - - # 准备参数 - path_params = { - "dms_instance_code": "nhbx4xHCKu" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit"]) - params = {} - headers = { - "Content-Type": "uiOLDw6xTG", - "Accept": "application/json", - "tenant-id": "f26NkmXKVC", - "Authorization": "74gS0mhVXW" -} - body = { - "version": "SVEAdzBHr1", - "data": [ - "iwXPD", - "ebiTp" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_geo_unit(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_geo_unit - 地质单元数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_geo_unit") - - # 准备参数 - path_params = { - "dms_instance_code": "oNHVdSJJYy" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit"]) - params = {} - headers = { - "Content-Type": "FoKufMGEqe", - "Accept": "application/json", - "tenant-id": "KdGs6bXRNL", - "Authorization": "aOn4JZB7GU" -} - body = { - "version": "4ItWxFdvec", - "data": [ - "sILhq", - "WeEjU" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_geo_unit(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit - 地质单元数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_geo_unit") - - # 准备参数 - path_params = { - "dms_instance_code": "QQioiCIneH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit"]) - params = {} - headers = { - "Content-Type": "eS53hYZgi2", - "Accept": "application/json", - "tenant-id": "S34AMOSdss", - "Authorization": "yw9iZGV7ot" -} - body = { - "version": "mEz5m1DTDQ", - "data": [ - "dtlfH", - "hetmN", - "NsEdV" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_geo_unit_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id} - 地质单元查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_geo_unit/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "KMHGWmzD05", - "version": "82RHA2h72b", - "id": "0PxeNiRiza" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_geo_unit/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "RJn9KYAYLl", - "Accept": "application/json", - "tenant-id": "3srN81bEbh", - "Authorization": "waJvNandpX" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 22 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dr_de_geology_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version} - 钻井地质设计列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "ykZg3I7ThJ", - "version": "mGgjnGGcPn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "Dkrn6cItF2", - "Accept": "application/json", - "tenant-id": "StiAHb9qAh", - "Authorization": "RMFPW4zkrf" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 90 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dr_de_geology(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dr_de_geology - 钻井地质设计数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dr_de_geology") - - # 准备参数 - path_params = { - "dms_instance_code": "SAOnJjdY5n" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology"]) - params = {} - headers = { - "Content-Type": "rwWoCgN5rB", - "Accept": "application/json", - "tenant-id": "R0AU8EXAKJ", - "Authorization": "4zxwZz2fR1" -} - body = { - "version": "FTKWg0WR8J", - "data": [ - "nGsxb", - "gshdV", - "TIORE" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dr_de_geology(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dr_de_geology - 钻井地质设计数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dr_de_geology") - - # 准备参数 - path_params = { - "dms_instance_code": "HhpHRLfR0A" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology"]) - params = {} - headers = { - "Content-Type": "Mf8NlLfGll", - "Accept": "application/json", - "tenant-id": "zySrt5udOB", - "Authorization": "XqDvOh0NjP" -} - body = { - "version": "pVeUfBx45y", - "data": [ - "nWTZU", - "UGsmP" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dr_de_geology(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology - 钻井地质设计数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dr_de_geology") - - # 准备参数 - path_params = { - "dms_instance_code": "reo5vyE2hz" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology"]) - params = {} - headers = { - "Content-Type": "2VdwDHGMoT", - "Accept": "application/json", - "tenant-id": "Xjs3pmUpSx", - "Authorization": "ZTdQ8EC5cK" -} - body = { - "version": "GQlB1Zwxe4", - "data": [ - "PfBMD" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dr_de_geology_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version}/{id} - 钻井地质设计查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dr_de_geology/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "AumOLFjusL", - "version": "xFbMsUa8aW", - "id": "CWbLTJ8qOt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dr_de_geology/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "RRnTJcWaeu", - "Accept": "application/json", - "tenant-id": "HI4ZcmZ4Ei", - "Authorization": "Lng04dpD9z" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 42 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_completion_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_completion/{version} - 井筒生产层段列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_completion/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "gzuUPuc8BO", - "version": "s2iYt7ODU3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "54LVr5cmFD", - "Accept": "application/json", - "tenant-id": "acVW7G6wA0", - "Authorization": "AqDSqfmDjs" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 19 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_completion(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_completion - 井筒生产层段数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_completion") - - # 准备参数 - path_params = { - "dms_instance_code": "ymQ0YOWRJ5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion"]) - params = {} - headers = { - "Content-Type": "84UeL9NvuE", - "Accept": "application/json", - "tenant-id": "1zhQG4ViH6", - "Authorization": "yWKTRO8x8f" -} - body = { - "version": "bx3hYwDvTQ", - "data": [ - "ACrja", - "qlxLh", - "oBpEU" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_completion(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_completion - 井筒生产层段数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_completion") - - # 准备参数 - path_params = { - "dms_instance_code": "pmscukmIIo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion"]) - params = {} - headers = { - "Content-Type": "qXe3KWlP0r", - "Accept": "application/json", - "tenant-id": "t1zDfdvdom", - "Authorization": "fQAztdwPhk" -} - body = { - "version": "VY7Uc7rjLg", - "data": [ - "HsEEd", - "mDgTM", - "ErMVr" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_completion(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_completion - 井筒生产层段数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_completion") - - # 准备参数 - path_params = { - "dms_instance_code": "jqlLMaz1EG" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion"]) - params = {} - headers = { - "Content-Type": "VDcfqZpkNb", - "Accept": "application/json", - "tenant-id": "xtcx9AgKv7", - "Authorization": "8vCqMaaPth" -} - body = { - "version": "MiQeL6CcKe", - "data": [ - "uxlhn" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_completion_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_completion/{version}/{id} - 井筒生产层段查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_completion/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "tznbAPfw12", - "version": "osMY6TlUJG", - "id": "NUpyvpFEWc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_completion/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "yt23H7GuC5", - "Accept": "application/json", - "tenant-id": "PfBCJKBJbq", - "Authorization": "NhFkC8ctsa" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 16 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim - 压裂基础数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "v4U1Vfm7jq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim"]) - params = {} - headers = { - "Content-Type": "fVwZQXADq5", - "Accept": "application/json", - "tenant-id": "9y0yiRt3Tj", - "Authorization": "6MjbWyJWoU" -} - body = { - "version": "myxwdHd0VN", - "data": [ - "ABJFl", - "RaRKc" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version} - 压裂基础数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "w9tGm9m9UJ", - "version": "UTrVnTo406" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "hErxnXai7W", - "Accept": "application/json", - "tenant-id": "DwqHUdczzZ", - "Authorization": "T6yVqgGPkn" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 78 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim - 压裂基础数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "NDDUWhaG5o" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim"]) - params = {} - headers = { - "Content-Type": "cVxtu4YF5r", - "Accept": "application/json", - "tenant-id": "iQGLM4DFEU", - "Authorization": "f4Iw0oyjk0" -} - body = { - "version": "xCrDYjB8dC", - "data": [ - "Aanum" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version}/{id} - 压裂基础数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "erW5PSg6xP", - "version": "IuCeZJQC4p", - "id": "PoUbci5Ji4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "R3nWW9S3Hi", - "Accept": "application/json", - "tenant-id": "ozBFHNsx4d", - "Authorization": "7A0RYaSRNz" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 93 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_bas_frac_incr_stim(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim - 压裂基础数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_bas_frac_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "3WQsZr7qkm" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_bas_frac_incr_stim"]) - params = {} - headers = { - "Content-Type": "mMEGNMz7o0", - "Accept": "application/json", - "tenant-id": "0n1ln3rDvX", - "Authorization": "FzB5dvvhal" -} - body = { - "version": "zAvcFBGSlI", - "data": [ - "qsafp" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version} - 压裂施工参数列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "H0x85c8o95", - "version": "2ZGGYdAU23" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "MgLh2TF0fv", - "Accept": "application/json", - "tenant-id": "KCdpY7ikRv", - "Authorization": "DkCVKMr3T0" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 39 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data - 压裂施工参数数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data") - - # 准备参数 - path_params = { - "dms_instance_code": "SxAFfKyjVv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data"]) - params = {} - headers = { - "Content-Type": "i2woarjZR4", - "Accept": "application/json", - "tenant-id": "v4dxDHS0Bi", - "Authorization": "jAbijAWhaZ" -} - body = { - "version": "0B449JUAOq", - "data": [ - "oxMWN", - "yIefv", - "jYgEh" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data - 压裂施工参数数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data") - - # 准备参数 - path_params = { - "dms_instance_code": "nQnvVqhIzH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data"]) - params = {} - headers = { - "Content-Type": "fwFXsGHIJR", - "Accept": "application/json", - "tenant-id": "LNjCLKvxDk", - "Authorization": "PG1405hsLE" -} - body = { - "version": "WXSbu6d3Q4", - "data": [ - "EldGf" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data - 压裂施工参数数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data") - - # 准备参数 - path_params = { - "dms_instance_code": "NRMsyYnL54" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data"]) - params = {} - headers = { - "Content-Type": "zo5OYaIOhs", - "Accept": "application/json", - "tenant-id": "8ubXMCLDVG", - "Authorization": "XE38Va6U5C" -} - body = { - "version": "D6yY7IDWo1", - "data": [ - "ipvVw", - "ptDox", - "ikmfo" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_fr_dh_ach_frac_build_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version}/{id} - 压裂施工参数查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/fr_dh_ach_frac_build_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "IWqqPY96UV", - "version": "T1HOEyeNT4", - "id": "8vGjsEbweo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/fr_dh_ach_frac_build_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "Ch6PKpIaMJ", - "Accept": "application/json", - "tenant-id": "2ZY04HyOJH", - "Authorization": "neHX77GyPn" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 76 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perf_interval_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version} - 射孔井段数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "XHUYNwnkTF", - "version": "7uoAEMXUwm" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "TjleNzNae2", - "Accept": "application/json", - "tenant-id": "P3I3pC75Qr", - "Authorization": "dZIi3pUq4s" -} - body = { - "isSearchCount": true, - "isUnderlineCase": true, - "query": { - "key1": "value1", - "key2": 14 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ach_perf_interval(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval - 射孔井段数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval") - - # 准备参数 - path_params = { - "dms_instance_code": "fbV22BJPOG" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval"]) - params = {} - headers = { - "Content-Type": "vppshUECez", - "Accept": "application/json", - "tenant-id": "mdGgN5qPQv", - "Authorization": "PkDQM5PG6g" -} - body = { - "version": "BcWELRUILN", - "data": [ - "zjMCH", - "TbZVM" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ach_perf_interval(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval - 射孔井段数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval") - - # 准备参数 - path_params = { - "dms_instance_code": "6WAIEXbbwj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval"]) - params = {} - headers = { - "Content-Type": "MPlGo0luBR", - "Accept": "application/json", - "tenant-id": "T4cDuSgkMV", - "Authorization": "7rm5h6hLBa" -} - body = { - "version": "7o53kOq2WG", - "data": [ - "MRveY" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perf_interval(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval - 射孔井段数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval") - - # 准备参数 - path_params = { - "dms_instance_code": "oVDDN0Pc4G" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval"]) - params = {} - headers = { - "Content-Type": "J6ga8SC1Yn", - "Accept": "application/json", - "tenant-id": "Gvrju2rcVc", - "Authorization": "snXt5plHvl" -} - body = { - "version": "gMvuSS7KK1", - "data": [ - "Lwvwq", - "HmCDY", - "vPWaM" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ach_perf_interval_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version}/{id} - 射孔井段数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perf_interval/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "eyqBmOC2Tj", - "version": "TjL1vUAZKS", - "id": "szeZDci3wN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perf_interval/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "Xtn8YbzmDd", - "Accept": "application/json", - "tenant-id": "1B89Phv6EO", - "Authorization": "Xx7Oc7hn2b" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 76 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perforate(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate - 射孔井段数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate") - - # 准备参数 - path_params = { - "dms_instance_code": "zY0IDp6qq1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate"]) - params = {} - headers = { - "Content-Type": "erhXgb6WZh", - "Accept": "application/json", - "tenant-id": "I8xQhTyeg4", - "Authorization": "ajp79q4Kl8" -} - body = { - "version": "jJvk6ihCdG", - "data": [ - "fGQXT", - "UDsZe", - "QYKco" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_perforate_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version} - 射孔数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "MmAbC54A3A", - "version": "pgOYH8YWo7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "d2on4RbZaE", - "Accept": "application/json", - "tenant-id": "zOkniyK6W6", - "Authorization": "n51P9L6FfL" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 80 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ach_perforate(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perforate - 射孔数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_perforate") - - # 准备参数 - path_params = { - "dms_instance_code": "lfbTgstUzc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate"]) - params = {} - headers = { - "Content-Type": "JpYotmfLcy", - "Accept": "application/json", - "tenant-id": "74Vv4g1Ka9", - "Authorization": "SaLeJEcaQl" -} - body = { - "version": "DbvUhcu8i8", - "data": [ - "irXVG", - "ewmgI" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ach_perforate(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perforate - 射孔数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_perforate") - - # 准备参数 - path_params = { - "dms_instance_code": "BWgfPeXUMg" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate"]) - params = {} - headers = { - "Content-Type": "4vkLTU2sy8", - "Accept": "application/json", - "tenant-id": "aOy4hSvJls", - "Authorization": "t0LayWbIkC" -} - body = { - "version": "iPU0M7pp63", - "data": [ - "eaWTK", - "RtPDo" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ach_perforate_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version}/{id} - 射孔数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ach_perforate/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "7XmOje79Nm", - "version": "RL0kLWk74f", - "id": "w5Dxb5rihT" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_perforate/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "CyMzkZscQa", - "Accept": "application/json", - "tenant-id": "g1SsO1WSxf", - "Authorization": "AqPY6yyzs5" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 39 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_string_list_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version} - 管柱元件列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "DnCUt4oNha", - "version": "JlwCqztvw1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "2ScUPMYdhk", - "Accept": "application/json", - "tenant-id": "vMXYiFAOgO", - "Authorization": "r3pLSTFtug" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 28 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_string_list_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version}/{id} - 管柱元件查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_string_list/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "V5zbYmtKl1", - "version": "QrtBpGzf4L", - "id": "LbSBJJLJzj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "hlELdC5cc6", - "Accept": "application/json", - "tenant-id": "TYsr7ABMnu", - "Authorization": "1tW2sCKiKp" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 63 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_string_list(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_string_list - 管柱元件数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_string_list") - - # 准备参数 - path_params = { - "dms_instance_code": "rqFQH5wx1i" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list"]) - params = {} - headers = { - "Content-Type": "9DOJJx3lKH", - "Accept": "application/json", - "tenant-id": "bmkvmtpVHI", - "Authorization": "RfbqTiFKgj" -} - body = { - "version": "Bn6cEFj34M", - "data": [ - "hHjjH" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_string_list(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_string_list - 管柱元件数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_string_list") - - # 准备参数 - path_params = { - "dms_instance_code": "hjf56dLHCI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list"]) - params = {} - headers = { - "Content-Type": "7dfkBjTPVU", - "Accept": "application/json", - "tenant-id": "i1P8I071hN", - "Authorization": "T6jnuJvdDs" -} - body = { - "version": "xcJxsXxs9W", - "data": [ - "OSmiR", - "pmVet", - "VZnqe" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_string_list(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list - 管柱元件数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_string_list") - - # 准备参数 - path_params = { - "dms_instance_code": "y48SyzLbGZ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_string_list"]) - params = {} - headers = { - "Content-Type": "7Fi1sfjtSM", - "Accept": "application/json", - "tenant-id": "VluvfDF4ZX", - "Authorization": "80U6Zt4BTU" -} - body = { - "version": "3LIRYwZyre", - "data": [ - "KUzGX", - "SotpF" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version} - 试油成果数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "JECKcgiOo5", - "version": "kBEaihIdws" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "l4PpDA7g17", - "Accept": "application/json", - "tenant-id": "AEseauvT1a", - "Authorization": "IKJ3tuzSnA" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 31 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_test_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version}/{id} - 试油成果数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "KLyKWaY8sS", - "version": "ekdisr4c2w", - "id": "o4U7bF0XWf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "6JuyCjuew3", - "Accept": "application/json", - "tenant-id": "Eu9wrAKCVV", - "Authorization": "lR0tpI5otx" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 90 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test - 试油成果数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test") - - # 准备参数 - path_params = { - "dms_instance_code": "wzTfEGLo9h" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test"]) - params = {} - headers = { - "Content-Type": "Nnx6u4lQOa", - "Accept": "application/json", - "tenant-id": "bjag2P3zHL", - "Authorization": "F3vP9boKBl" -} - body = { - "version": "b6j3HboXHI", - "data": [ - "YOEVM" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_test(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test - 试油成果数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test") - - # 准备参数 - path_params = { - "dms_instance_code": "kcJKjRz61J" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test"]) - params = {} - headers = { - "Content-Type": "TxyJ9sPHWH", - "Accept": "application/json", - "tenant-id": "Ol0HpxSE0d", - "Authorization": "yEeWr9DuEj" -} - body = { - "version": "nxpSb9Rd1x", - "data": [ - "RDzFD" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_test(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test - 试油成果数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test") - - # 准备参数 - path_params = { - "dms_instance_code": "PYrrOSuR1L" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test"]) - params = {} - headers = { - "Content-Type": "ObDH3hQyVp", - "Accept": "application/json", - "tenant-id": "P0VZh4Is9T", - "Authorization": "WD0iAkvB95" -} - body = { - "version": "8THUKpReLZ", - "data": [ - "GCnyh", - "ddUGv", - "dFYGs" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_test_daily_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version} - 试油日报列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "wBqZNTiDhY", - "version": "Tvd6iLlCbr" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "LsXuRquTJe", - "Accept": "application/json", - "tenant-id": "dV5qIG2bcH", - "Authorization": "THT7VuN3i1" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 71 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_test_daily(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily - 试油日报数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "sqduXzkxtM" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily"]) - params = {} - headers = { - "Content-Type": "SlAdRw4DSg", - "Accept": "application/json", - "tenant-id": "E1aFSP2d9b", - "Authorization": "4JTbSdFtay" -} - body = { - "version": "BtH1GX0uW9", - "data": [ - "pAHUo", - "GpHUn", - "PctKZ" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_test_daily(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily - 试油日报数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "d8ox8eMc1H" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily"]) - params = {} - headers = { - "Content-Type": "g55nxLUJr8", - "Accept": "application/json", - "tenant-id": "SYnTRvVFbY", - "Authorization": "QPSdhG2UUK" -} - body = { - "version": "2S48xsoKtY", - "data": [ - "ShYTP" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_test_daily(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily - 试油日报数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "r0VCjG8YvF" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily"]) - params = {} - headers = { - "Content-Type": "WZOt5ngFl2", - "Accept": "application/json", - "tenant-id": "Fn2pIepA4q", - "Authorization": "Ifssyz31FT" -} - body = { - "version": "wXUeeJVqiA", - "data": [ - "Prwmh", - "KEGVD", - "jCCle" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_test_daily_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version}/{id} - 试油日报查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_test_daily/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "mXMtrncCCs", - "version": "LkpxsVfuZY", - "id": "2E2f2yIdRo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_test_daily/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "0s2kLTy33l", - "Accept": "application/json", - "tenant-id": "LGICjnZieq", - "Authorization": "zoSMoGwYxX" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 91 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version} - 井泵注程序数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "i6Sx6Uol3y", - "version": "NBGoHlxhwK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "jwxGkA7r8E", - "Accept": "application/json", - "tenant-id": "YfmmwWIa3S", - "Authorization": "TVDbjTec4I" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 33 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version}/{id} - 井泵注程序数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "tW7cOX4v5P", - "version": "uLBPZITY7b", - "id": "DjPQOVzScd" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "AHvUFvF9au", - "Accept": "application/json", - "tenant-id": "3vg3QcQtyJ", - "Authorization": "mPOfKQSo18" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 11 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject - 井泵注程序数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject") - - # 准备参数 - path_params = { - "dms_instance_code": "UinmeVRtDa" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject"]) - params = {} - headers = { - "Content-Type": "xjMuynNsbN", - "Accept": "application/json", - "tenant-id": "eGpz6ZVO2a", - "Authorization": "bxtK2fCaHt" -} - body = { - "version": "ieq8Wdqja9", - "data": [ - "Qzzne", - "cxKIS" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject - 井泵注程序数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject") - - # 准备参数 - path_params = { - "dms_instance_code": "AANUiAKRno" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject"]) - params = {} - headers = { - "Content-Type": "MCkdHRnaPd", - "Accept": "application/json", - "tenant-id": "0Es4ii3Etu", - "Authorization": "sdiqyukcj3" -} - body = { - "version": "7S38Q3mQ0i", - "data": [ - "uZucY", - "SBNgf" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_stage_pump_inject(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject - 井泵注程序数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_stage_pump_inject") - - # 准备参数 - path_params = { - "dms_instance_code": "mMWon9cVTn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_stage_pump_inject"]) - params = {} - headers = { - "Content-Type": "f7xmhCt5KF", - "Accept": "application/json", - "tenant-id": "hUDuLyKZJr", - "Authorization": "A7IW3ejXGH" -} - body = { - "version": "FnFjzCuwme", - "data": [ - "JsAjY", - "HJWSX" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_trip_connect_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data - 起下钻接单根数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data") - - # 准备参数 - path_params = { - "dms_instance_code": "3NHrDFKU0T" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data"]) - params = {} - headers = { - "Content-Type": "4XEEu86sWo", - "Accept": "application/json", - "tenant-id": "bJcomwy0BM", - "Authorization": "pgirgHPJ1e" -} - body = { - "version": "kEWtBXmFAr", - "data": [ - "AkOvu" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_trip_connect_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version} - 起下钻接单根数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "AZ4CYjlFfW", - "version": "kOuJUHm4gK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "h8uGGaqtYV", - "Accept": "application/json", - "tenant-id": "zfOSTFxlFF", - "Authorization": "qqntNjL3MX" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 57 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_trip_connect_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data - 起下钻接单根数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data") - - # 准备参数 - path_params = { - "dms_instance_code": "bReGRWgFE1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data"]) - params = {} - headers = { - "Content-Type": "jO7oFxOpbb", - "Accept": "application/json", - "tenant-id": "BsFSqu3Ou2", - "Authorization": "IXRvxIRHYA" -} - body = { - "version": "HGKwMv3l4x", - "data": [ - "Dtmmp" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_trip_connect_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data - 起下钻接单根数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data") - - # 准备参数 - path_params = { - "dms_instance_code": "NXZz5Guuk1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data"]) - params = {} - headers = { - "Content-Type": "digxmGxHUG", - "Accept": "application/json", - "tenant-id": "k584y7xkUY", - "Authorization": "jYejUekTIg" -} - body = { - "version": "4tF9ZAPTSG", - "data": [ - "hzKlq", - "jmVYl", - "KNaLw" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_trip_connect_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version}/{id} - 起下钻接单根查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_trip_connect_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "qOekhxvRJG", - "version": "5HW0mzxgoD", - "id": "Z1Q2R1cj1T" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_trip_connect_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "Pwn5MCMuie", - "Accept": "application/json", - "tenant-id": "Vi0AE8EHW9", - "Authorization": "cTX50uSzx0" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 26 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_show_stat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version} - 油气显示统计表列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "G9pdoD6e7Q", - "version": "9AV3E1C6DH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "h9PsBZJCiw", - "Accept": "application/json", - "tenant-id": "tRvyHONYT1", - "Authorization": "aisz5ITVmT" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 6 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_rpt_show_stat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat - 油气显示统计表数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "RDBccto7qB" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat"]) - params = {} - headers = { - "Content-Type": "VEoaiPBXEr", - "Accept": "application/json", - "tenant-id": "lOTKNpPHav", - "Authorization": "dIiO9ZSABV" -} - body = { - "version": "9ot9BN5Gqz", - "data": [ - "rFedn", - "CTZmW", - "VBYZR" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_rpt_show_stat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat - 油气显示统计表数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "4aZf8BtcQt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat"]) - params = {} - headers = { - "Content-Type": "5gZGUZvSh5", - "Accept": "application/json", - "tenant-id": "fszS1PDduT", - "Authorization": "2LdBoAoQyl" -} - body = { - "version": "JTmvb31zKs", - "data": [ - "oVWDh", - "ErLVx", - "XhAhi" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_show_stat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat - 油气显示统计表数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "DyFEuSiOkv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat"]) - params = {} - headers = { - "Content-Type": "bE17gGwSIM", - "Accept": "application/json", - "tenant-id": "xUBJuiVYrj", - "Authorization": "ThCE45jf2b" -} - body = { - "version": "VO8DENAbvY", - "data": [ - "oWGaq", - "QnOYR", - "qEQsw" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_rpt_show_stat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version}/{id} - 油气显示统计表查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_show_stat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "gQNxsE5SzD", - "version": "nNscqZooFm", - "id": "UYD5KNGpFW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_show_stat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "FeZc0MfHqJ", - "Accept": "application/json", - "tenant-id": "2hYkyIac4L", - "Authorization": "gEbTL1yERo" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 95 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record - 录井综合记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record") - - # 准备参数 - path_params = { - "dms_instance_code": "1DcFNMJ9Qj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record"]) - params = {} - headers = { - "Content-Type": "7SjIkQ4V6R", - "Accept": "application/json", - "tenant-id": "DtCywzEG2R", - "Authorization": "85N3ktADRP" -} - body = { - "version": "c0KnTBhr82", - "data": [ - "xDVkr", - "ikMeV" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version}/{id} - 录井综合记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "oiXkyUGTXz", - "version": "AHyXkypg6h", - "id": "CFHBdlYywd" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "bQY1cIhzzm", - "Accept": "application/json", - "tenant-id": "K5h5n2F3UN", - "Authorization": "CLEWuSVhgW" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 63 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record - 录井综合记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record") - - # 准备参数 - path_params = { - "dms_instance_code": "GHv6Avy5Nk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record"]) - params = {} - headers = { - "Content-Type": "httenCse7u", - "Accept": "application/json", - "tenant-id": "uTbW7zPt08", - "Authorization": "tVcSOM24oS" -} - body = { - "version": "XljNcFhyDy", - "data": [ - "pSEMm" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record - 录井综合记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record") - - # 准备参数 - path_params = { - "dms_instance_code": "zdNHMDbaz5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record"]) - params = {} - headers = { - "Content-Type": "vo2NOl0uc9", - "Accept": "application/json", - "tenant-id": "EjI6Gb0PGd", - "Authorization": "UPeqXIkV0k" -} - body = { - "version": "nZEX5xOKrS", - "data": [ - "mkugy" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_logging_comp_record_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version} - 录井综合记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_logging_comp_record/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "FhMvRTLJs7", - "version": "Qf2rpIfpJq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_logging_comp_record/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "FPkVJS3ack", - "Accept": "application/json", - "tenant-id": "3th4ubyJ43", - "Authorization": "0mxBmj9RER" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 56 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_bas_test_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version} - 试油基础数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Qa9K6GDZ8F", - "version": "8U9qfdV20J" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "ZN5uKLnzv3", - "Accept": "application/json", - "tenant-id": "RX1Y9UIiOx", - "Authorization": "lBef0y5kHk" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 35 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_bas_test_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version}/{id} - 试油基础数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_bas_test/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "zUaxrshtda", - "version": "Niag2llezo", - "id": "K590Y4gVEo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "RqHaxqA2Ot", - "Accept": "application/json", - "tenant-id": "wHTGLeNNWf", - "Authorization": "LTfehgVc38" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 10 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_bas_test(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test - 试油基础数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_bas_test") - - # 准备参数 - path_params = { - "dms_instance_code": "xZSI5JNVjL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test"]) - params = {} - headers = { - "Content-Type": "i1y1Qx2THA", - "Accept": "application/json", - "tenant-id": "3987GYAo3p", - "Authorization": "h9Yw3uEClX" -} - body = { - "version": "SBmhRmdgRC", - "data": [ - "ZeGKt", - "wUPca" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_bas_test(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_bas_test - 试油基础数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_bas_test") - - # 准备参数 - path_params = { - "dms_instance_code": "y9i8fdqxmf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test"]) - params = {} - headers = { - "Content-Type": "KPMw9nRASV", - "Accept": "application/json", - "tenant-id": "3VRSm3k0rP", - "Authorization": "q43IaJGLhP" -} - body = { - "version": "wOvY2e0QmU", - "data": [ - "JpcEn", - "JrQUP", - "VKven" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_bas_test(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_bas_test - 试油基础数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_bas_test") - - # 准备参数 - path_params = { - "dms_instance_code": "7Lo60eUHpV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_bas_test"]) - params = {} - headers = { - "Content-Type": "0ADpjtCe5o", - "Accept": "application/json", - "tenant-id": "zxV9mmHuJ2", - "Authorization": "lvzk5zyXUV" -} - body = { - "version": "gSZN1VrHEk", - "data": [ - "tPyBj", - "cezRf" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_query_dh_con_sum_oil_tube_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/query/dh_con_sum_oil_tube/{version} - 施工总结油管记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/query/dh_con_sum_oil_tube/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "HpMbrOKNDO", - "version": "Wmwl59cBXg" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/query/dh_con_sum_oil_tube/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "2254s0NWdg", - "Accept": "application/json", - "tenant-id": "aOGGjJFrMq", - "Authorization": "Oia4fIUUTL" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 82 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube - 施工总结油管记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube") - - # 准备参数 - path_params = { - "dms_instance_code": "cExdiUa4ss" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube"]) - params = {} - headers = { - "Content-Type": "QnF3AQ2aGs", - "Accept": "application/json", - "tenant-id": "O0OGJRxeiW", - "Authorization": "FW0WGPTMPH" -} - body = { - "version": "ZlK9LwR7zN", - "data": [ - "FRlbd", - "RmEDF", - "bjAQB" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube - 施工总结油管记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube") - - # 准备参数 - path_params = { - "dms_instance_code": "3KH1wtBGDh" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube"]) - params = {} - headers = { - "Content-Type": "dQAP7Lb8R9", - "Accept": "application/json", - "tenant-id": "8mrG9PoU1x", - "Authorization": "QE6CfoUnPq" -} - body = { - "version": "RZxGB6pYFn", - "data": [ - "ngmrH" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube - 施工总结油管记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube") - - # 准备参数 - path_params = { - "dms_instance_code": "dgojfEiPdI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube"]) - params = {} - headers = { - "Content-Type": "PCwTPh6h9r", - "Accept": "application/json", - "tenant-id": "68MN4geMXs", - "Authorization": "HzNzNThykB" -} - body = { - "version": "r6Le4dzh8G", - "data": [ - "jOBQg" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_con_sum_oil_tube_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube/{version}/{id} - 施工总结油管记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_oil_tube/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "ejTjSNNcvy", - "version": "iwxSkoUNTT", - "id": "f7LQ0egAEr" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_oil_tube/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "uYspkPPKYv", - "Accept": "application/json", - "tenant-id": "PrcIFe17Ks", - "Authorization": "SfxlNFlzYn" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 88 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_query_dh_bas_layering_job_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/query/dh_bas_layering_job/{version} - 酸化压裂分层作业列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/query/dh_bas_layering_job/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "rTttbOkgGC", - "version": "jVArHqhBVF" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/query/dh_bas_layering_job/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "cVKHUCeYGp", - "Accept": "application/json", - "tenant-id": "RYwxu9OMcV", - "Authorization": "HSqTtAbFUS" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 29 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_bas_layering_job(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job - 酸化压裂分层作业数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job") - - # 准备参数 - path_params = { - "dms_instance_code": "KBED8f1fMd" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job"]) - params = {} - headers = { - "Content-Type": "2A5kdmzo9Z", - "Accept": "application/json", - "tenant-id": "Ogwyba4cmj", - "Authorization": "jSC2ZV38xQ" -} - body = { - "version": "7338Ps4pEw", - "data": [ - "NrbIw", - "qgumK" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_bas_layering_job(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job - 酸化压裂分层作业数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job") - - # 准备参数 - path_params = { - "dms_instance_code": "oq3Snjdlkg" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job"]) - params = {} - headers = { - "Content-Type": "3DXA7uF8db", - "Accept": "application/json", - "tenant-id": "5t6vU6l4pw", - "Authorization": "oulV8zZNAV" -} - body = { - "version": "vae85fPYf9", - "data": [ - "jcaqL", - "LTVwJ", - "sGMEw" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_bas_layering_job(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job - 酸化压裂分层作业数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job") - - # 准备参数 - path_params = { - "dms_instance_code": "SvlRVvgkd1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job"]) - params = {} - headers = { - "Content-Type": "nAHQZJ8h75", - "Accept": "application/json", - "tenant-id": "x3z8a1OR7a", - "Authorization": "nYgbP8QEFI" -} - body = { - "version": "LPnSHbqFdZ", - "data": [ - "jTLIy", - "ZzzqP" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_bas_layering_job_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job/{version}/{id} - 酸化压裂分层作业查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_bas_layering_job/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "o4ZENAVBLW", - "version": "2tAbRGVeTP", - "id": "z7FMXlxrS2" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_layering_job/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "IsRRVbYUZi", - "Accept": "application/json", - "tenant-id": "gX0HZXgEwF", - "Authorization": "Y8ipMnd84w" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 77 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_proppant_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version} - 支撑剂数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "fqXOrNFvZP", - "version": "8iUlsNw0tO" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "oZRtI3mATM", - "Accept": "application/json", - "tenant-id": "G3IymsjVWN", - "Authorization": "6IMQWsvAzZ" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 68 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ach_proppant_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data - 支撑剂数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data") - - # 准备参数 - path_params = { - "dms_instance_code": "UWUUO3z5NW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data"]) - params = {} - headers = { - "Content-Type": "jKYc6gbSmd", - "Accept": "application/json", - "tenant-id": "Tc4uftbrrd", - "Authorization": "8QVhZdIf15" -} - body = { - "version": "sKoxYT1u1I", - "data": [ - "rliAN", - "IUbcs" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ach_proppant_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data - 支撑剂数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data") - - # 准备参数 - path_params = { - "dms_instance_code": "e3yyhAzari" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data"]) - params = {} - headers = { - "Content-Type": "L7VD49aXm0", - "Accept": "application/json", - "tenant-id": "mgJVInpNiz", - "Authorization": "H52crOXdX5" -} - body = { - "version": "VcyoyMpJnZ", - "data": [ - "SPPQZ", - "YRCwn", - "oWlmn" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ach_proppant_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data - 支撑剂数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data") - - # 准备参数 - path_params = { - "dms_instance_code": "woNGSgqw4r" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data"]) - params = {} - headers = { - "Content-Type": "CqqYdoSV3I", - "Accept": "application/json", - "tenant-id": "Iearq87T89", - "Authorization": "nm33w2mI83" -} - body = { - "version": "pVv8sUJAtN", - "data": [ - "GUVZL", - "icfyq", - "ZMBWv" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ach_proppant_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version}/{id} - 支撑剂数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ach_proppant_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "HRASrJb1TP", - "version": "HtSSgYudb8", - "id": "MIKsxjo5S8" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ach_proppant_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "ivgY7JpSUI", - "Accept": "application/json", - "tenant-id": "LdZ7tPMN5m", - "Authorization": "sDoa7Sfpjh" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 67 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_dst_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version} - 地层测试列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "7h55FXPO8R", - "version": "o2k6PkdCas" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "6vZoZH9Nzq", - "Accept": "application/json", - "tenant-id": "B9Zm2t7e7h", - "Authorization": "Qy1Edhn8AX" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 18 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_dst(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_dst - 地层测试数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_dst") - - # 准备参数 - path_params = { - "dms_instance_code": "AhIL1Wa337" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst"]) - params = {} - headers = { - "Content-Type": "HiaoshB4Ug", - "Accept": "application/json", - "tenant-id": "U0PoX38d2C", - "Authorization": "qO9d7yUaGd" -} - body = { - "version": "iGrEiRn3X4", - "data": [ - "fpHnt", - "Pimdv", - "yeDQY" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_dst(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_dst - 地层测试数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_dst") - - # 准备参数 - path_params = { - "dms_instance_code": "UhfJ7kymGb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst"]) - params = {} - headers = { - "Content-Type": "DqJn1WkUIj", - "Accept": "application/json", - "tenant-id": "do9tDS09Tm", - "Authorization": "lWBWAsOzxS" -} - body = { - "version": "vnDubLK80d", - "data": [ - "DBdxa", - "wCiRL" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_dst(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst - 地层测试数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_dst") - - # 准备参数 - path_params = { - "dms_instance_code": "vbQlbZ9E2k" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst"]) - params = {} - headers = { - "Content-Type": "x4DHp9IKBC", - "Accept": "application/json", - "tenant-id": "OQlM9J3uCQ", - "Authorization": "YzP6emVdFi" -} - body = { - "version": "lbiJnnSG9e", - "data": [ - "BWabI", - "qqReE", - "HEBKb" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_dst_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version}/{id} - 地层测试查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_dst/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "oXtthOps3v", - "version": "leuzQtrMRX", - "id": "IGeKPKJIau" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_dst/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "QCkFAhBJpU", - "Accept": "application/json", - "tenant-id": "wkfw1xl1vA", - "Authorization": "uGz8fG3lMN" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 43 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_water_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version} - 水分析列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "8fBQ6f7xCp", - "version": "BZoZ05oWbp" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "dQRm3ErqaR", - "Accept": "application/json", - "tenant-id": "qmBpPNy3be", - "Authorization": "ZGcRpssx12" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 93 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_test_water(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_water - 水分析数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_water") - - # 准备参数 - path_params = { - "dms_instance_code": "2RZ5IPBo2m" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water"]) - params = {} - headers = { - "Content-Type": "dHfi0mDw9A", - "Accept": "application/json", - "tenant-id": "HyFLcvUnWy", - "Authorization": "vWVsmXjStO" -} - body = { - "version": "u49EavgduS", - "data": [ - "BGNkF", - "mzNeB" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_test_water(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_water - 水分析数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_water") - - # 准备参数 - path_params = { - "dms_instance_code": "HwoG9yEHGe" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water"]) - params = {} - headers = { - "Content-Type": "CJV7G14qbG", - "Accept": "application/json", - "tenant-id": "jD87In0kD6", - "Authorization": "E12MXEAPYd" -} - body = { - "version": "0aO4UHssJQ", - "data": [ - "ayoAf" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_water(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water - 水分析数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_water") - - # 准备参数 - path_params = { - "dms_instance_code": "Pxi9UwLx88" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water"]) - params = {} - headers = { - "Content-Type": "aVrPbVRj8r", - "Accept": "application/json", - "tenant-id": "M1JbQKZy0v", - "Authorization": "DxOlo9j8Ij" -} - body = { - "version": "OYapT2sSUR", - "data": [ - "fHldr", - "LCEUs" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_test_water_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version}/{id} - 水分析查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_water/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "t8CUkq7nUK", - "version": "8FLzDekEN4", - "id": "OaYfdeuMrl" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_water/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "qRwVIurNYE", - "Accept": "application/json", - "tenant-id": "vjArddqkdb", - "Authorization": "YeEjK2C6oJ" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 14 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version} - 测温测压数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "6VHdDrfktR", - "version": "2UMuocJkEb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "SPxYGB6Au1", - "Accept": "application/json", - "tenant-id": "7pindX90Ia", - "Authorization": "aPYC2rjgOr" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 3 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data - 测温测压数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data") - - # 准备参数 - path_params = { - "dms_instance_code": "uKDskAg1M0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data"]) - params = {} - headers = { - "Content-Type": "iULFdkQJXf", - "Accept": "application/json", - "tenant-id": "MaSynvB15y", - "Authorization": "jSY01EvRbw" -} - body = { - "version": "Gz8Gm478oe", - "data": [ - "sQXfN" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data - 测温测压数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data") - - # 准备参数 - path_params = { - "dms_instance_code": "oNY0Emn23M" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data"]) - params = {} - headers = { - "Content-Type": "Y3apCyd7xh", - "Accept": "application/json", - "tenant-id": "CyVN2JmTQ0", - "Authorization": "4cAQEyB2wL" -} - body = { - "version": "CAYW9dLKS2", - "data": [ - "miPlp" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data - 测温测压数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data") - - # 准备参数 - path_params = { - "dms_instance_code": "Ifw6JQYaKA" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data"]) - params = {} - headers = { - "Content-Type": "tX2ePaRUBd", - "Accept": "application/json", - "tenant-id": "dI7KpaZV2v", - "Authorization": "5GKEjh3Oc8" -} - body = { - "version": "rIviQa1XNJ", - "data": [ - "okOIN", - "HcKyt" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_pres_temp_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version}/{id} - 测温测压数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "ognQLCqRwv", - "version": "xmntdaweyl", - "id": "IlYbtB5OWV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "QXHsGTTeo7", - "Accept": "application/json", - "tenant-id": "msPy2BC6CY", - "Authorization": "if9NEDeogh" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 1 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_farmation_test_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version} - 地层测试成果列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "W2EOwoqZOY", - "version": "VhiTgQEwRT" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "bHhPczVutS", - "Accept": "application/json", - "tenant-id": "RDxK5S4O6o", - "Authorization": "14VcTDKfFj" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 77 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_farmation_test(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test - 地层测试成果数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test") - - # 准备参数 - path_params = { - "dms_instance_code": "g2kdL6vYtU" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test"]) - params = {} - headers = { - "Content-Type": "0DqTKfHEYC", - "Accept": "application/json", - "tenant-id": "UqgtI550hX", - "Authorization": "iHzi6TGvnt" -} - body = { - "version": "ZUp7BqHdKR", - "data": [ - "rMrKB" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_farmation_test(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test - 地层测试成果数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test") - - # 准备参数 - path_params = { - "dms_instance_code": "yo1n0Zx0U1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test"]) - params = {} - headers = { - "Content-Type": "nYTzzUSnSH", - "Accept": "application/json", - "tenant-id": "ImGRiHIBwX", - "Authorization": "TNmtVR3xSH" -} - body = { - "version": "klljGQjo0U", - "data": [ - "wdkbp", - "brVmq" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_farmation_test(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test - 地层测试成果数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test") - - # 准备参数 - path_params = { - "dms_instance_code": "l3UxIIKLWv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test"]) - params = {} - headers = { - "Content-Type": "5hXf8kr49i", - "Accept": "application/json", - "tenant-id": "CCqpgig0sB", - "Authorization": "1UQaKgERje" -} - body = { - "version": "vdUgRzLlrX", - "data": [ - "vHhQd", - "vUYqU", - "CtMfJ" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_farmation_test_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version}/{id} - 地层测试成果查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_farmation_test/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "rf1ZEBfs8D", - "version": "rZRv7LRUMD", - "id": "iptoASsAN6" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_farmation_test/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "cT6g8Gz02i", - "Accept": "application/json", - "tenant-id": "SfjQqGGgJw", - "Authorization": "RBI9PyAoZ3" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 17 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_base_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version} - 试油成果统计数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "dtxbo63hfA", - "version": "4OOGNpOaDi" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "xSfPsNzqLF", - "Accept": "application/json", - "tenant-id": "V6j5rMwwaF", - "Authorization": "Wpzespjc59" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 28 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_test_base_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data - 试油成果统计数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data") - - # 准备参数 - path_params = { - "dms_instance_code": "eHNKkwsSTL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data"]) - params = {} - headers = { - "Content-Type": "K81C7H6hXi", - "Accept": "application/json", - "tenant-id": "UZYP4ruaWi", - "Authorization": "JhkpKuR7Y6" -} - body = { - "version": "wJBMVWUryM", - "data": [ - "WWpIP", - "ITAek" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_test_base_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data - 试油成果统计数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data") - - # 准备参数 - path_params = { - "dms_instance_code": "N8rUKHWC0b" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data"]) - params = {} - headers = { - "Content-Type": "FjqgnikmN7", - "Accept": "application/json", - "tenant-id": "XBEpjvcjst", - "Authorization": "ULu9mg1Sui" -} - body = { - "version": "hWJrjJVQrb", - "data": [ - "IwhHZ", - "BcRQY" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_test_base_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data - 试油成果统计数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data") - - # 准备参数 - path_params = { - "dms_instance_code": "NB2zFP9wxX" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data"]) - params = {} - headers = { - "Content-Type": "5h9tZx3RW3", - "Accept": "application/json", - "tenant-id": "giO4suzw8u", - "Authorization": "h7d5BRL34b" -} - body = { - "version": "YbIW0kpW7c", - "data": [ - "Jzugb", - "lUOWt", - "BzfKV" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_test_base_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version}/{id} - 试油成果统计数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_test_base_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "L1CwalTc5d", - "version": "oOmjKzVZyU", - "id": "0NYxw47LVt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_test_base_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "DTSx6Ve1Om", - "Accept": "application/json", - "tenant-id": "RulT8nP5nR", - "Authorization": "lcBlk4AEr0" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 80 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version} - 测温测压列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "J91XM5Sbce", - "version": "3puX3bh9o5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "VNbT5sJR4U", - "Accept": "application/json", - "tenant-id": "xwFWkjTBM5", - "Authorization": "YBLfnPtjmB" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 9 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ach_pres_temp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp - 测温测压数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp") - - # 准备参数 - path_params = { - "dms_instance_code": "whhenl0U1Z" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp"]) - params = {} - headers = { - "Content-Type": "GH7M05w4ud", - "Accept": "application/json", - "tenant-id": "MufA3rbr8x", - "Authorization": "cc36r6x6Li" -} - body = { - "version": "Y8oBW2XX3H", - "data": [ - "QDers" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ach_pres_temp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp - 测温测压数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp") - - # 准备参数 - path_params = { - "dms_instance_code": "Qr47VdVTaj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp"]) - params = {} - headers = { - "Content-Type": "Npy9uR1lrP", - "Accept": "application/json", - "tenant-id": "LUlNqiSq5T", - "Authorization": "TEZgqXZidv" -} - body = { - "version": "6VBgpd9QB1", - "data": [ - "VwOpZ", - "ztjic" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_pres_temp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp - 测温测压数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp") - - # 准备参数 - path_params = { - "dms_instance_code": "8u0z2eb9jq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp"]) - params = {} - headers = { - "Content-Type": "B89eWXj8G7", - "Accept": "application/json", - "tenant-id": "IhzNH84y0b", - "Authorization": "SmHkYuQIKo" -} - body = { - "version": "OCUIIcd94X", - "data": [ - "NgLfG" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_pres_temp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version}/{id} - 测温测压查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_pres_temp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "A8sqUAlQuF", - "version": "YP681mqo7y", - "id": "fkbpNUvsDC" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_pres_temp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "Tf5fqJG7NR", - "Accept": "application/json", - "tenant-id": "L9KNfaGbST", - "Authorization": "ydIL2Tweri" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 14 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version} - 排液求产动态数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "1tvIMioS37", - "version": "yVqt6Wx7WY" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "9ud0gBv6Nd", - "Accept": "application/json", - "tenant-id": "4oFqdFfRAV", - "Authorization": "IE7fFRTaTh" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 71 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version}/{id} - 排液求产动态数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "PvbwwSPPfi", - "version": "vNnBE8av4P", - "id": "qYSZ5pKzIi" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "WmyqDcyySj", - "Accept": "application/json", - "tenant-id": "RXLE0V20UW", - "Authorization": "nqlDUTJh1F" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 82 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat - 排液求产动态数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "0UOK8hmhkI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat"]) - params = {} - headers = { - "Content-Type": "nr7E1CKgxe", - "Accept": "application/json", - "tenant-id": "XMgVBrEcaC", - "Authorization": "NpozTgvqUd" -} - body = { - "version": "usx6lE4lQC", - "data": [ - "SJXmE" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat - 排液求产动态数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "tOqaxDQfnn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat"]) - params = {} - headers = { - "Content-Type": "Ut0Rl6DLMn", - "Accept": "application/json", - "tenant-id": "D8dtExSG4h", - "Authorization": "J8HhaAFTG9" -} - body = { - "version": "8njG0GLTDz", - "data": [ - "WQeBF", - "BVKoW", - "EiBsA" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_dyn_dat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat - 排液求产动态数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "5jDILLrQPq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_dyn_dat"]) - params = {} - headers = { - "Content-Type": "v7KkyDjYa7", - "Accept": "application/json", - "tenant-id": "xPYd1o3HWM", - "Authorization": "pDvRUblDUR" -} - body = { - "version": "SeZCP45lfe", - "data": [ - "SWVqC" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version} - 排液求产成果数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "hBKDClJIxl", - "version": "YSmyX94FK3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "glKcmBsMxW", - "Accept": "application/json", - "tenant-id": "wZFv7om0so", - "Authorization": "eNZIhzCOOa" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 84 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat - 排液求产成果数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "aw8GrwAbDf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat"]) - params = {} - headers = { - "Content-Type": "wDCWqFI5P1", - "Accept": "application/json", - "tenant-id": "xTToo5PxmF", - "Authorization": "4nEW19yU17" -} - body = { - "version": "zxVvphYDVj", - "data": [ - "KSUEE", - "OpnRK", - "Kogze" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version}/{id} - 排液求产成果数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "0ersS0FYoG", - "version": "tkuXICjDg1", - "id": "Cm26rGTjaL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "RP4O1JnaOG", - "Accept": "application/json", - "tenant-id": "8o3ewrxhb6", - "Authorization": "ldPmyL7vfp" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 42 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat - 排液求产成果数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "SLSW24rLdE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat"]) - params = {} - headers = { - "Content-Type": "idFzi8beXa", - "Accept": "application/json", - "tenant-id": "wJMYMpyNLF", - "Authorization": "NPEgEmVkAc" -} - body = { - "version": "P9ISwJTv7J", - "data": [ - "FEqKO", - "sLtzb" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_tp_ops_cleanup_prod_res_dat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat - 排液求产成果数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat") - - # 准备参数 - path_params = { - "dms_instance_code": "zTp4YzodAC" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_cleanup_prod_res_dat"]) - params = {} - headers = { - "Content-Type": "7rZBJpSltU", - "Accept": "application/json", - "tenant-id": "ioZxGuo5i2", - "Authorization": "WOX1piiJHs" -} - body = { - "version": "WgEG83lAmJ", - "data": [ - "MnzNH", - "HJPvs", - "aiiKi" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_construction_summary_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version} - 施工总结列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "vF9PXdCTjG", - "version": "jrIg77Bxyq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "4MniZYVA6U", - "Accept": "application/json", - "tenant-id": "X3MT6AS2Oa", - "Authorization": "3cbIriEfMr" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 45 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_construction_summary(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_construction_summary - 施工总结数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_construction_summary") - - # 准备参数 - path_params = { - "dms_instance_code": "NBThAXem1K" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary"]) - params = {} - headers = { - "Content-Type": "UrpkNdsMoL", - "Accept": "application/json", - "tenant-id": "4zefDqHHpm", - "Authorization": "TE7HnGeAJx" -} - body = { - "version": "ABJutsDTNu", - "data": [ - "pRsVV", - "nPFqX", - "tlJyY" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_construction_summary(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_construction_summary - 施工总结数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_construction_summary") - - # 准备参数 - path_params = { - "dms_instance_code": "gftE4uPSBz" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary"]) - params = {} - headers = { - "Content-Type": "I6mreisnQM", - "Accept": "application/json", - "tenant-id": "WAUWdN2Nz9", - "Authorization": "ue5tBap5aa" -} - body = { - "version": "5v7UV1T5wW", - "data": [ - "kwfWH", - "udyAe", - "FJoaV" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_construction_summary(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary - 施工总结数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_construction_summary") - - # 准备参数 - path_params = { - "dms_instance_code": "7QNivg9ec9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary"]) - params = {} - headers = { - "Content-Type": "yMXr0FbRpG", - "Accept": "application/json", - "tenant-id": "muWFJFZHsk", - "Authorization": "EnWYAYPWO8" -} - body = { - "version": "NMohsuFpkj", - "data": [ - "UPxQA", - "sHOSg" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_construction_summary_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version}/{id} - 施工总结查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_construction_summary/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "8wRPcFxZA7", - "version": "gejZqPcRc4", - "id": "ZGenVrcNOR" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_construction_summary/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "HpzzyJ7LP6", - "Accept": "application/json", - "tenant-id": "hGJ6ylUamW", - "Authorization": "osr9SE4tbb" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 32 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_job_daily_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version} - 井下作业日报列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "NnkS4Y9GZn", - "version": "M27v20GEDH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "r2y8Q8brAy", - "Accept": "application/json", - "tenant-id": "v3fkJEhrRu", - "Authorization": "m4M0oQh1fu" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 45 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_ops_job_daily(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily - 井下作业日报数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "BHrN54zPGJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily"]) - params = {} - headers = { - "Content-Type": "rEqRtJtDj3", - "Accept": "application/json", - "tenant-id": "YxZw37QD8O", - "Authorization": "wiyIS0T0T5" -} - body = { - "version": "fRagK5bwdx", - "data": [ - "uJotQ", - "lhKWH", - "nihBh" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_ops_job_daily(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily - 井下作业日报数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "zWkvu20ZLw" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily"]) - params = {} - headers = { - "Content-Type": "QHH6KAhJfc", - "Accept": "application/json", - "tenant-id": "AiEiEoAhHD", - "Authorization": "0bJvh02qvF" -} - body = { - "version": "NdUKSGHYRw", - "data": [ - "Uglmy", - "QjZLP", - "Gxlwe" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_ops_job_daily(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily - 井下作业日报数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "53lf7Lr8LI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily"]) - params = {} - headers = { - "Content-Type": "ER9CqaveDJ", - "Accept": "application/json", - "tenant-id": "rZeVdyWLub", - "Authorization": "3ejB5Ab5Qn" -} - body = { - "version": "tgnv6AWkol", - "data": [ - "rQqxk", - "ZAtQl" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_ops_job_daily_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version}/{id} - 井下作业日报查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_ops_job_daily/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "UQUTvWM5H8", - "version": "LnK8jSp0Q2", - "id": "02Zp1apwHa" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_ops_job_daily/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "uOoxlddi4U", - "Accept": "application/json", - "tenant-id": "GWecZJhkma", - "Authorization": "DVxhhDXFeZ" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 25 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_con_sum_management_info_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version} - 施工总结管理信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Q3U08ZvuYO", - "version": "tUEmI6WU2y" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "V3Lyb14YFZ", - "Accept": "application/json", - "tenant-id": "xs0SPqXKyO", - "Authorization": "j0tik5RiUb" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 50 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_con_sum_management_info(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info - 施工总结管理信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info") - - # 准备参数 - path_params = { - "dms_instance_code": "0b2N8kOqnA" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info"]) - params = {} - headers = { - "Content-Type": "eSsz4UBzGf", - "Accept": "application/json", - "tenant-id": "fhDSHWYvjx", - "Authorization": "JsrF0tH52V" -} - body = { - "version": "717ubSZ9TQ", - "data": [ - "zNaWc", - "VcQno", - "wXfzL" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_con_sum_management_info(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info - 施工总结管理信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info") - - # 准备参数 - path_params = { - "dms_instance_code": "jXVQ3F7ctn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info"]) - params = {} - headers = { - "Content-Type": "WajFFrI7M6", - "Accept": "application/json", - "tenant-id": "8CaVIlQKtg", - "Authorization": "ulEUAxRbVm" -} - body = { - "version": "KiRsiwgJxl", - "data": [ - "ZVRAX", - "rpeMM", - "lDprK" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_con_sum_management_info(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info - 施工总结管理信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info") - - # 准备参数 - path_params = { - "dms_instance_code": "hTzr7U38Xf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info"]) - params = {} - headers = { - "Content-Type": "H7ebZOUZR9", - "Accept": "application/json", - "tenant-id": "igzWkbhxrB", - "Authorization": "kKDSOhcs2w" -} - body = { - "version": "tITFULSSyu", - "data": [ - "znhvn", - "vhagt" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_con_sum_management_info_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version}/{id} - 施工总结管理信息查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_con_sum_management_info/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "MtjarALwVh", - "version": "YrcecW3zh6", - "id": "yKppuNCu3Z" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_con_sum_management_info/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "fMjKWNuh9I", - "Accept": "application/json", - "tenant-id": "PbBAJ6lsv5", - "Authorization": "1BfVEgqGxB" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 78 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version} - 井壁取心统计列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "MvZVs59Xlx", - "version": "gaTiMZGfET" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "SsxF8ybuj2", - "Accept": "application/json", - "tenant-id": "2nVPC11V76", - "Authorization": "n5dw4Ir2TR" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 67 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat - 井壁取心统计数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "F18HMbb6tp" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat"]) - params = {} - headers = { - "Content-Type": "Yi5BOP1O2j", - "Accept": "application/json", - "tenant-id": "Yo1ZcYW1R4", - "Authorization": "8nvWubqbZI" -} - body = { - "version": "IUTjWyBuqA", - "data": [ - "inQeh" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat - 井壁取心统计数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "JUAP4c3ulN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat"]) - params = {} - headers = { - "Content-Type": "MUgrPiHXYH", - "Accept": "application/json", - "tenant-id": "caDSWAPnda", - "Authorization": "ku56mVGkmo" -} - body = { - "version": "zIipAhOE8U", - "data": [ - "hmkTQ", - "nhjoQ", - "zvmAw" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat - 井壁取心统计数据添加 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat") - - # 准备参数 - path_params = { - "dms_instance_code": "OzrAjqTDM3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat"]) - params = {} - headers = { - "Content-Type": "zhC4nSVBUe", - "Accept": "application/json", - "tenant-id": "sD2sIIoAPK", - "Authorization": "b9AhPRCYkx" -} - body = { - "version": "raMNFu5yf2", - "data": [ - "rCTas" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_rpt_sidewall_core_stat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version}/{id} - 井壁取心统计查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "DTG3dBu0dW", - "version": "7JXQZWcZtZ", - "id": "vBbRw9YFXI" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_sidewall_core_stat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "RLeCLPa8eQ", - "Accept": "application/json", - "tenant-id": "pSzfWqZwah", - "Authorization": "r7TvbSYeb6" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 9 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_scan_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version} - 岩心图像扫描记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "vV5pLjRyxs", - "version": "B12JXTmAAs" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "DbpXJiWBPq", - "Accept": "application/json", - "tenant-id": "ZrIUAYtCpk", - "Authorization": "mbZZe62vmx" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 47 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_core_scan(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan - 岩心图像扫描记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan") - - # 准备参数 - path_params = { - "dms_instance_code": "tznB134PXH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan"]) - params = {} - headers = { - "Content-Type": "T03ii2U13y", - "Accept": "application/json", - "tenant-id": "7ECbhq6AX9", - "Authorization": "rzS5P82Npf" -} - body = { - "version": "5nmSUpVckd", - "data": [ - "MAKfh" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_core_scan(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan - 岩心图像扫描记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan") - - # 准备参数 - path_params = { - "dms_instance_code": "5N9YonhCrM" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan"]) - params = {} - headers = { - "Content-Type": "QQ6q1QlzNO", - "Accept": "application/json", - "tenant-id": "rpN8Hi07iD", - "Authorization": "qTz6n2YzRq" -} - body = { - "version": "9jNSorL1RX", - "data": [ - "Nkjuu", - "mzqsk" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_scan(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan - 岩心图像扫描记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan") - - # 准备参数 - path_params = { - "dms_instance_code": "0nxMhF8buf" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan"]) - params = {} - headers = { - "Content-Type": "r0BBJpqbkt", - "Accept": "application/json", - "tenant-id": "T2d3Qqsm97", - "Authorization": "B71dhefUbL" -} - body = { - "version": "dHRwHf9f9G", - "data": [ - "TvmSJ", - "QetnX", - "zaJJP" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_core_scan_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version}/{id} - 岩心图像扫描记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_scan/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "C2nhihTXuv", - "version": "iRzs38aGh5", - "id": "e4Z3fPVpyP" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_scan/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "Kf6bmViUJh", - "Accept": "application/json", - "tenant-id": "Wt6Ms4zrXj", - "Authorization": "w5C7QuPOrm" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 35 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_data_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version} - 气测迟到数据表列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "5SQLSXDjm7", - "version": "Z5VWymtF3p" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "NB7k4sMTe1", - "Accept": "application/json", - "tenant-id": "Tag22cuD2b", - "Authorization": "BNrcYJ3757" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 88 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_gas_data(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data - 气测迟到数据表数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data") - - # 准备参数 - path_params = { - "dms_instance_code": "hR7h6VwgDl" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data"]) - params = {} - headers = { - "Content-Type": "CILOb4jXRZ", - "Accept": "application/json", - "tenant-id": "tNDbI9Cr86", - "Authorization": "C2q18JkPzR" -} - body = { - "version": "OCy6mryCgA", - "data": [ - "mVkaG" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_gas_data(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data - 气测迟到数据表数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data") - - # 准备参数 - path_params = { - "dms_instance_code": "euaKWJZRD4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data"]) - params = {} - headers = { - "Content-Type": "QC4pMCIsPN", - "Accept": "application/json", - "tenant-id": "gZnPP9L2uj", - "Authorization": "hHOVk6uUCB" -} - body = { - "version": "NsVeo26uct", - "data": [ - "snqgE", - "rpjUD" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_data(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data - 气测迟到数据表数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data") - - # 准备参数 - path_params = { - "dms_instance_code": "ahrUsBDMqs" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data"]) - params = {} - headers = { - "Content-Type": "h9Cx4IeQgm", - "Accept": "application/json", - "tenant-id": "rov55xAwvC", - "Authorization": "TOB3V5YwvB" -} - body = { - "version": "6Glu1ivlr2", - "data": [ - "lbrlP" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_gas_data_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version}/{id} - 气测迟到数据表查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_data/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "Vcpqnm63iD", - "version": "gAi7AAkM3i", - "id": "SH0mFOFodG" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_data/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "qNxms4s85h", - "Accept": "application/json", - "tenant-id": "1yB3eWbbLq", - "Authorization": "QSJ5ybw4wt" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 78 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_residual_carbon(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon - 残余碳分析记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon") - - # 准备参数 - path_params = { - "dms_instance_code": "BCDpcdC3G5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon"]) - params = {} - headers = { - "Content-Type": "0a0TzXyq5q", - "Accept": "application/json", - "tenant-id": "lMKsmOlMMh", - "Authorization": "7CQUfPhtyp" -} - body = { - "version": "RNPRKOnsRD", - "data": [ - "WHrLx" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_residual_carbon_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version}/{id} - 残余碳分析记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "7wIi4S7jBK", - "version": "9NDwkFtkFm", - "id": "4LL94UiP7x" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "x0Aj0yDg8x", - "Accept": "application/json", - "tenant-id": "MwW1COWmx2", - "Authorization": "s0QMQNZdpv" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 26 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_residual_carbon(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon - 残余碳分析记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon") - - # 准备参数 - path_params = { - "dms_instance_code": "w2qgvbPYhJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon"]) - params = {} - headers = { - "Content-Type": "vMQEAhB2kI", - "Accept": "application/json", - "tenant-id": "32M41dijAi", - "Authorization": "wrFo7Ntaex" -} - body = { - "version": "mcysxwNsUk", - "data": [ - "YYPqW" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_residual_carbon(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon - 残余碳分析记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon") - - # 准备参数 - path_params = { - "dms_instance_code": "ETVfAI5DBc" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon"]) - params = {} - headers = { - "Content-Type": "S9RVURreDx", - "Accept": "application/json", - "tenant-id": "sHOoMG5xOQ", - "Authorization": "qO06DqbT9u" -} - body = { - "version": "jPFVXDUgpf", - "data": [ - "oRWKb", - "Htrif", - "qCvLW" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_residual_carbon_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version} - 残余碳分析记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_residual_carbon/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "dJHziGACqS", - "version": "kEOkb5lnRK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_residual_carbon/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "LjulvDFiuj", - "Accept": "application/json", - "tenant-id": "LYYdALx7z8", - "Authorization": "4HgycRMRWS" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 21 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version} - 井壁取心列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "UUVV7u0Po7", - "version": "TnuuUpSoct" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "rGTvbOs6JF", - "Accept": "application/json", - "tenant-id": "gjsce3pZaL", - "Authorization": "683TIyV86H" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 63 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_sidewall_core(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core - 井壁取心数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core") - - # 准备参数 - path_params = { - "dms_instance_code": "GTglbT5wiM" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core"]) - params = {} - headers = { - "Content-Type": "ZKp4yJ9FNj", - "Accept": "application/json", - "tenant-id": "5QV2CP9NV3", - "Authorization": "nOxyqHGPHm" -} - body = { - "version": "YtS9lRS1VS", - "data": [ - "zxeJs", - "sAxDM" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version}/{id} - 井壁取心查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RiRJk98wVn", - "version": "TUtkWb9iPf", - "id": "Ej4lnYHbSF" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "YFueN9L8CP", - "Accept": "application/json", - "tenant-id": "y8suWEooE0", - "Authorization": "BEe4OoCb7y" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 66 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_sidewall_core(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core - 井壁取心数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core") - - # 准备参数 - path_params = { - "dms_instance_code": "imL0VLGSqC" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core"]) - params = {} - headers = { - "Content-Type": "BEdmUSIzyf", - "Accept": "application/json", - "tenant-id": "DNzhEIMIam", - "Authorization": "fjGFSSaMoA" -} - body = { - "version": "inTDFSuHKN", - "data": [ - "UmVlm" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core - 井壁取心数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core") - - # 准备参数 - path_params = { - "dms_instance_code": "9DCAQidpuS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core"]) - params = {} - headers = { - "Content-Type": "4dpdnFjQhj", - "Accept": "application/json", - "tenant-id": "lxmgROYMDN", - "Authorization": "U58E192P3C" -} - body = { - "version": "fdethoPKSJ", - "data": [ - "JWaZc", - "Rncau" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_gas(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_gas - 气测录井基础信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_gas") - - # 准备参数 - path_params = { - "dms_instance_code": "1M1qOAncPw" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas"]) - params = {} - headers = { - "Content-Type": "JHp59e88gw", - "Accept": "application/json", - "tenant-id": "xfNU263zkp", - "Authorization": "UHpxP8ucqm" -} - body = { - "version": "IDbm19iYHE", - "data": [ - "VKShe" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_gas_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version} - 气测录井基础信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "HDxjXtOdiu", - "version": "SGEn1GvlI9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "YemkIJFdhi", - "Accept": "application/json", - "tenant-id": "ZpUEYvx0WC", - "Authorization": "Y9rYqPvQCX" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 29 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_gas(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_gas - 气测录井基础信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_gas") - - # 准备参数 - path_params = { - "dms_instance_code": "ea4HRD2q52" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas"]) - params = {} - headers = { - "Content-Type": "GdazNCOwye", - "Accept": "application/json", - "tenant-id": "CRVWmTRovJ", - "Authorization": "YGACMbqYBu" -} - body = { - "version": "uFdK8JnMFs", - "data": [ - "iunJD" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_gas(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas - 气测录井基础信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_gas") - - # 准备参数 - path_params = { - "dms_instance_code": "RxRsYYO2Px" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas"]) - params = {} - headers = { - "Content-Type": "gc5LlSiiAq", - "Accept": "application/json", - "tenant-id": "l6j63pFbb3", - "Authorization": "vRK6fvltdT" -} - body = { - "version": "wTOVWenIFS", - "data": [ - "aYyIi", - "CVfZs", - "VVhyp" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_gas_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version}/{id} - 气测录井基础信息查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_gas/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "J8bM9ijCOO", - "version": "ezo8v9vaFS", - "id": "VETaO3PeqS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_gas/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "sXNULGtcXS", - "Accept": "application/json", - "tenant-id": "Nh1tTCDQZB", - "Authorization": "xe1rFrpXWV" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 17 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version}/{id} - 录井综合解释查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "NicYvIoC83", - "version": "AodT8Snrjp", - "id": "i73hLum29K" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "TaykCIG96I", - "Accept": "application/json", - "tenant-id": "GOPiQTPV8R", - "Authorization": "VdBGGSuSFX" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 5 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp - 录井综合解释数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "B7xFgG2pah" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp"]) - params = {} - headers = { - "Content-Type": "3s30J9HkuQ", - "Accept": "application/json", - "tenant-id": "av4XYym0PE", - "Authorization": "E2x8bKtdQn" -} - body = { - "version": "Z8GcQNbqk1", - "data": [ - "MybRg", - "brxca" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp - 录井综合解释数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "3OnjjuKade" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp"]) - params = {} - headers = { - "Content-Type": "W3sl5SmgiI", - "Accept": "application/json", - "tenant-id": "RsAvj8Lbjh", - "Authorization": "kG5N438xjb" -} - body = { - "version": "OlqYZ7nI8T", - "data": [ - "sFShh", - "WKHMp", - "JakIB" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp - 录井综合解释数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "X6hw7flqzr" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp"]) - params = {} - headers = { - "Content-Type": "MqZXVF96Z2", - "Accept": "application/json", - "tenant-id": "fTpLu2klfd", - "Authorization": "plkdCAHqEJ" -} - body = { - "version": "nCRvqCPn3I", - "data": [ - "SjQHw" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_mud_logging_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version} - 录井综合解释列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_mud_logging_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "8Ks8PyQg14", - "version": "knNnXeI7xb" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_mud_logging_interp/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "XFUvVoueVW", - "Accept": "application/json", - "tenant-id": "3q4Lf3RNUT", - "Authorization": "mfMMrWXeH6" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 14 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_logging_daily_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version} - 录井日报列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Odx26wEzSV", - "version": "pCL445WVLE" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "sF3DTNFXwb", - "Accept": "application/json", - "tenant-id": "vXyX7oq9cL", - "Authorization": "gH5krAOh3c" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 19 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_rpt_logging_daily(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily - 录井日报数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "MJ3s8fiG79" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily"]) - params = {} - headers = { - "Content-Type": "eHPTfcXhXU", - "Accept": "application/json", - "tenant-id": "tP129USlso", - "Authorization": "lirnOTFke5" -} - body = { - "version": "v1RHrX7c0k", - "data": [ - "rnJUk", - "wDCWB", - "zAahO" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_rpt_logging_daily(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily - 录井日报数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "v17w8lScUJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily"]) - params = {} - headers = { - "Content-Type": "2D3et70uL6", - "Accept": "application/json", - "tenant-id": "RjhPn3TUMo", - "Authorization": "EUjO0vnTvw" -} - body = { - "version": "W9hl8eZycB", - "data": [ - "uXIjE", - "CttAp", - "FitkY" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_rpt_logging_daily(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily - 录井日报数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily") - - # 准备参数 - path_params = { - "dms_instance_code": "3PNlNGO3l1" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily"]) - params = {} - headers = { - "Content-Type": "DjrRycAX5V", - "Accept": "application/json", - "tenant-id": "oQJ1c97ko8", - "Authorization": "eAqbrV7HEI" -} - body = { - "version": "q4L0ERujyC", - "data": [ - "SnyVk" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_rpt_logging_daily_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version}/{id} - 录井日报查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_rpt_logging_daily/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "717bUkyriE", - "version": "hUtMxpXoUF", - "id": "rHnIg5aAC8" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_rpt_logging_daily/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "AeDOXrZall", - "Accept": "application/json", - "tenant-id": "CFeKBzI1TU", - "Authorization": "rdyHS1weC6" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 1 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version} - 酸化基础数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "10GAJdvdrA", - "version": "M81E6Uwx8O" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "MKKdUbvV84", - "Accept": "application/json", - "tenant-id": "fikKQQgtRi", - "Authorization": "sPks6JNy1I" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 7 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim - 酸化基础数据数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "GuAVQEPEJq" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim"]) - params = {} - headers = { - "Content-Type": "YVFhL92h2n", - "Accept": "application/json", - "tenant-id": "1Q5wMD5rzr", - "Authorization": "B7r3qOLZrE" -} - body = { - "version": "q5ObGyzlWC", - "data": [ - "wRHmZ", - "qIwoz" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim - 酸化基础数据数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "h2FVttwCLQ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim"]) - params = {} - headers = { - "Content-Type": "WJ5OeL2NVQ", - "Accept": "application/json", - "tenant-id": "VGK8OI9bfi", - "Authorization": "pq5szZW9d6" -} - body = { - "version": "ZqAZ94UrNF", - "data": [ - "WvaUz", - "esdqG" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim - 酸化基础数据数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim") - - # 准备参数 - path_params = { - "dms_instance_code": "D0SzSVCSaL" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim"]) - params = {} - headers = { - "Content-Type": "BEjasCyCV9", - "Accept": "application/json", - "tenant-id": "qoknDsT6LB", - "Authorization": "8aoHHRsHLt" -} - body = { - "version": "6LZr3neo2X", - "data": [ - "RhMoP", - "vJfPb", - "LAePe" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_dh_bas_acid_incr_stim_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version}/{id} - 酸化基础数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/dh_bas_acid_incr_stim/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "r8zkvzxEPA", - "version": "8kXyVGk9O2", - "id": "BJ9t0Oa86p" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/dh_bas_acid_incr_stim/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "k9zxTiycOT", - "Accept": "application/json", - "tenant-id": "awZbskK9ho", - "Authorization": "62ExfakFlf" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 8 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_cuttings_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version} - 岩屑描述记录列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "sCSr8hl8A2", - "version": "rhkgedlRi5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "fiBChhH8qK", - "Accept": "application/json", - "tenant-id": "R1AulipJ38", - "Authorization": "8JhdsFuPQ7" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 79 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_cuttings(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings - 岩屑描述记录数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings") - - # 准备参数 - path_params = { - "dms_instance_code": "yVdvAiLG9B" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings"]) - params = {} - headers = { - "Content-Type": "YvFuoRN1dW", - "Accept": "application/json", - "tenant-id": "g30uby4R26", - "Authorization": "KMgl7u11Dm" -} - body = { - "version": "6cE3Ja5Kvr", - "data": [ - "iDzOZ", - "Eazdv", - "hBORs" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_cuttings(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings - 岩屑描述记录数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings") - - # 准备参数 - path_params = { - "dms_instance_code": "nf9QCsnVv2" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings"]) - params = {} - headers = { - "Content-Type": "ytmg5VeJee", - "Accept": "application/json", - "tenant-id": "64PD7nejgO", - "Authorization": "cuoPTB0LYs" -} - body = { - "version": "4TXmVEf5ci", - "data": [ - "zShFV", - "QVdZf" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_cuttings(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings - 岩屑描述记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings") - - # 准备参数 - path_params = { - "dms_instance_code": "0ZkplFo2Xx" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings"]) - params = {} - headers = { - "Content-Type": "9JJkc5Sce4", - "Accept": "application/json", - "tenant-id": "QQvXvjUPb0", - "Authorization": "vuR6aqziLp" -} - body = { - "version": "KPG9sspTnw", - "data": [ - "MpjGS", - "zJTAV" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_cuttings_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version}/{id} - 岩屑描述记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_cuttings/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "NGa8Isa0P7", - "version": "3jkQlyTr1U", - "id": "5yS6Avkbtm" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_cuttings/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "mubdzJsYAc", - "Accept": "application/json", - "tenant-id": "w9dPm7Uryv", - "Authorization": "0Sati45OSa" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 64 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version} - 录井解释成果表列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "OVHQ8ZQCdN", - "version": "xWFFq0F1d8" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "FGpQ4ZozRG", - "Accept": "application/json", - "tenant-id": "wLMY0cTMEy", - "Authorization": "f7KEH7oKHr" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 91 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp - 录井解释成果表数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "ZxiSnFsKM0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp"]) - params = {} - headers = { - "Content-Type": "rggkZBj783", - "Accept": "application/json", - "tenant-id": "D54fT3nwp4", - "Authorization": "HMO2QDPkeC" -} - body = { - "version": "tdDpMGv26O", - "data": [ - "eDlMd", - "eKoyt" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp - 录井解释成果表数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "ZbbloNvEaN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp"]) - params = {} - headers = { - "Content-Type": "466gt6tGNh", - "Accept": "application/json", - "tenant-id": "qiHRO9DJxY", - "Authorization": "pzE8dQeSpI" -} - body = { - "version": "Wov1aqJ989", - "data": [ - "jrwtd", - "nrzGF" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp - 录井解释成果表数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "kHPVG1QEri" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp"]) - params = {} - headers = { - "Content-Type": "mHtOAKVCmG", - "Accept": "application/json", - "tenant-id": "9S2oUaPpTk", - "Authorization": "DROWhf5jbV" -} - body = { - "version": "13QwNkeEiz", - "data": [ - "wWRDx", - "uYtRD" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_mud_logging_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version}/{id} - 录井解释成果表查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_mud_logging_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "FNP8qG5aCc", - "version": "Pjt8pYaSCW", - "id": "6r4cYt8TN3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_mud_logging_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "vCntQoTonQ", - "Accept": "application/json", - "tenant-id": "cQ3dYwRbz0", - "Authorization": "OTYeywRzU8" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 91 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_core_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version}/{id} - 钻井取心筒次数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "srgUAPESlJ", - "version": "0c1Ipw0raC", - "id": "stgW7XPoTo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "gUReMN0r5F", - "Accept": "application/json", - "tenant-id": "FqLWCuntXR", - "Authorization": "fpQBoLBqaX" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 67 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_core(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core - 钻井取心筒次数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core") - - # 准备参数 - path_params = { - "dms_instance_code": "1NhLOaYN9v" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core"]) - params = {} - headers = { - "Content-Type": "mOcAWlGyPR", - "Accept": "application/json", - "tenant-id": "q8qqQVQKmN", - "Authorization": "H7CufjWdhs" -} - body = { - "version": "4fqeYtXehT", - "data": [ - "cYHHG", - "cgDGC" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_core(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core - 钻井取心筒次数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core") - - # 准备参数 - path_params = { - "dms_instance_code": "LIDom0PHxW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core"]) - params = {} - headers = { - "Content-Type": "x1UoxwbIdA", - "Accept": "application/json", - "tenant-id": "N5vxiegWP2", - "Authorization": "ivVFep5kuL" -} - body = { - "version": "99Umfo7RAK", - "data": [ - "lGnNL" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core - 钻井取心筒次数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core") - - # 准备参数 - path_params = { - "dms_instance_code": "MChLWW3Dty" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core"]) - params = {} - headers = { - "Content-Type": "1zsQj4fYr0", - "Accept": "application/json", - "tenant-id": "eJoXeCbtW9", - "Authorization": "nDUfYA0k2v" -} - body = { - "version": "ms6oIJFsE4", - "data": [ - "ynUBQ", - "gJkSr", - "udhIK" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version} - 钻井取心筒次数据列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "Uxw6imrsXb", - "version": "9w7tVa0Z6p" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "9NMu5VvREg", - "Accept": "application/json", - "tenant-id": "S5jVF0O1kp", - "Authorization": "YFH8fKgvsX" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 15 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_desc_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version} - 钻井取心描述记录列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "9DltUSAlK1", - "version": "3zRdMZFS2x" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "dc4FWwBGVI", - "Accept": "application/json", - "tenant-id": "WWBAa4FHS1", - "Authorization": "QoNpfyWMSG" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 2 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_core_desc(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc - 钻井取心描述记录数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "N9Yj5s8HPP" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc"]) - params = {} - headers = { - "Content-Type": "gCkTExxFUq", - "Accept": "application/json", - "tenant-id": "4PZGMPH0fO", - "Authorization": "YCS0spL6bB" -} - - try: - # 发送请求 - response = self.session.put(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_core_desc(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc - 钻井取心描述记录数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "ULHVnELqC3" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc"]) - params = {} - headers = { - "Content-Type": "I5567esES6", - "Accept": "application/json", - "tenant-id": "SDQzxXHyr4", - "Authorization": "JQRsYjGsv7" -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_core_desc(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc - 钻井取心描述记录数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "rZH215avjK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc"]) - params = {} - headers = { - "Content-Type": "RuwMORf56X", - "Accept": "application/json", - "tenant-id": "ClzFL8Khwq", - "Authorization": "qG2KRhEvyG" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_core_desc_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version}/{id} - 钻井取心描述记录查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_core_desc/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "RA45S4tH23", - "version": "AA6zbeNX7l", - "id": "ZdCXNgycoN" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_core_desc/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "RKako6G31l", - "Accept": "application/json", - "tenant-id": "f3Tj2N3by4", - "Authorization": "NIUeN9eoAL" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 78 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version} - 气测解释成果列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "NOMaJ3MogI", - "version": "rILLXk8gwz" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "pXuflGx3Z8", - "Accept": "application/json", - "tenant-id": "C6MeV3k7rE", - "Authorization": "ZEJxisU3U0" -} - body = { - "isSearchCount": true, - "isUnderlineCase": true, - "query": { - "key1": "value1", - "key2": 59 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_gas_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp - 气测解释成果数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "CPCcABpVA5" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp"]) - params = {} - headers = { - "Content-Type": "cKe6LtxAdR", - "Accept": "application/json", - "tenant-id": "kBhAy58vb2", - "Authorization": "Aos15AGmYq" -} - body = { - "version": "KUMCdErW4i", - "data": [ - "QOHwQ", - "apnlz" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_gas_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp - 气测解释成果数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "voaLp0LgD4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp"]) - params = {} - headers = { - "Content-Type": "DBdSwdrRjt", - "Accept": "application/json", - "tenant-id": "XrPg1wJ4ne", - "Authorization": "CIay3ONJRt" -} - body = { - "version": "fG1YYzCC6J", - "data": [ - "FcFoJ", - "tPZLk", - "sKqnI" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_gas_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp - 气测解释成果数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "guzDYfvyzi" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp"]) - params = {} - headers = { - "Content-Type": "hLFQuW0YFT", - "Accept": "application/json", - "tenant-id": "VO7KMiesxm", - "Authorization": "fion3OyekH" -} - body = { - "version": "4BbpvzzaDJ", - "data": [ - "nFLxY" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_gas_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version}/{id} - 气测解释成果查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_gas_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "xr64LpdkUu", - "version": "zgZAYKXPDe", - "id": "JsC2pBR9DZ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_gas_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "td6VJTZDsd", - "Accept": "application/json", - "tenant-id": "FFJ77KlFR3", - "Authorization": "jv5vdLZgiI" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 22 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version} - 取心描述列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "5OLoi5Ayv2", - "version": "xbifkO2xfC" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "VjBBkmKxqc", - "Accept": "application/json", - "tenant-id": "jQw7ysCYTR", - "Authorization": "4NseGchJDS" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 35 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc - 取心描述数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "u0MlFtC0YK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc"]) - params = {} - headers = { - "Content-Type": "hOBf3Qv4I3", - "Accept": "application/json", - "tenant-id": "TTTBIBXM6O", - "Authorization": "SCfMZ6Pkxa" -} - body = { - "version": "CtSMflunWC", - "data": [ - "XEUnt", - "MljUG" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc - 取心描述数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "94OJ3dBrRJ" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc"]) - params = {} - headers = { - "Content-Type": "xkumMdPzkQ", - "Accept": "application/json", - "tenant-id": "xXJDJKBRwg", - "Authorization": "uW79w7ttqt" -} - body = { - "version": "lpw8rf6OgJ", - "data": [ - "YzVmA" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc - 取心描述数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc") - - # 准备参数 - path_params = { - "dms_instance_code": "arrUmHKdly" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc"]) - params = {} - headers = { - "Content-Type": "A2Uq2a4wvl", - "Accept": "application/json", - "tenant-id": "kzPKZRzodr", - "Authorization": "fYZ2HxaXiV" -} - body = { - "version": "8rVwKhYCtK", - "data": [ - "dMbsW", - "GwwlN" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_sidewall_core_desc_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version}/{id} - 取心描述查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_sidewall_core_desc/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "XsEq9s8V48", - "version": "MLrpeJcXfQ", - "id": "2vITqgsutH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_sidewall_core_desc/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "iV7X6IJ7hq", - "Accept": "application/json", - "tenant-id": "wYyiSA1AcP", - "Authorization": "akIuGe09gF" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 25 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_sealing_core_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version} - 钻井取心列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "ZzJ5buNpa8", - "version": "vhSDGpsapv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "vQzid1jJRv", - "Accept": "application/json", - "tenant-id": "EDfCxynWy1", - "Authorization": "XiT81kG1eN" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 81 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_sealing_core(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core - 钻井取心数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core") - - # 准备参数 - path_params = { - "dms_instance_code": "MvWmp1TwNj" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core"]) - params = {} - headers = { - "Content-Type": "JsOf2k7LL8", - "Accept": "application/json", - "tenant-id": "8QMkq11LIi", - "Authorization": "vqjDmmevdA" -} - body = { - "version": "bZQ66NPieO", - "data": [ - "KQrur", - "sCBnY" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_sealing_core(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core - 钻井取心数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core") - - # 准备参数 - path_params = { - "dms_instance_code": "KHDLxkSlJT" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core"]) - params = {} - headers = { - "Content-Type": "l1tZCR62J3", - "Accept": "application/json", - "tenant-id": "9e3PA270IB", - "Authorization": "jnlbezwWPz" -} - body = { - "version": "9De3PQu0pJ", - "data": [ - "NtVyk", - "bYogB", - "Bdsmd" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_sealing_core(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core - 钻井取心数据添加 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core") - - # 准备参数 - path_params = { - "dms_instance_code": "6NV0DyoYuD" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core"]) - params = {} - headers = { - "Content-Type": "EFRqXMfwUb", - "Accept": "application/json", - "tenant-id": "2CTBQt0WM7", - "Authorization": "VcunIBA6CL" -} - body = { - "version": "FBpZQkiJ4o", - "data": [ - "JbpcR" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_sealing_core_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version}/{id} - 钻井取心查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_sealing_core/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "8YDOpQMOyd", - "version": "DvBfdlPnBS", - "id": "E4HR9JZyxK" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_sealing_core/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "m4VCXcORF8", - "Accept": "application/json", - "tenant-id": "dvpv16YKI1", - "Authorization": "yl1aCGYAys" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 96 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version} - 单井地质分层列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "J65YZTcwO7", - "version": "6nUIEo4f5i" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "mRjspbKM8S", - "Accept": "application/json", - "tenant-id": "OkxvgpWyzz", - "Authorization": "feq5WHDGOq" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 79 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme - 单井地质分层数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme") - - # 准备参数 - path_params = { - "dms_instance_code": "sxSjpnWrO0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme"]) - params = {} - headers = { - "Content-Type": "cPucsoeBZ8", - "Accept": "application/json", - "tenant-id": "gf9bC0gZQY", - "Authorization": "iZ7bG9h2Tj" -} - body = { - "version": "O1xyR5ykcy", - "data": [ - "LWJDI", - "btVvx", - "JeVYk" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme - 单井地质分层数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme") - - # 准备参数 - path_params = { - "dms_instance_code": "7gFHfhR4C0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme"]) - params = {} - headers = { - "Content-Type": "z15yOpQ55t", - "Accept": "application/json", - "tenant-id": "9FhQ7kmxN6", - "Authorization": "4OMsiSsxTK" -} - body = { - "version": "K6qEitiuvE", - "data": [ - "cJRKi", - "prGiz", - "kJfUN" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme - 单井地质分层数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme") - - # 准备参数 - path_params = { - "dms_instance_code": "PTV10OmHFW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme"]) - params = {} - headers = { - "Content-Type": "Iz515svwz6", - "Accept": "application/json", - "tenant-id": "EdiVw71DtY", - "Authorization": "UohEybdiF6" -} - body = { - "version": "bbxNxTj8HV", - "data": [ - "GbcHK" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_well_zonation_scheme_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version}/{id} - 单井地质分层查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_well_zonation_scheme/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "SRCArbcPdS", - "version": "lSV0lT9ki8", - "id": "VXg39KdLPv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_well_zonation_scheme/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "PuSYYrnDLX", - "Accept": "application/json", - "tenant-id": "dVnRdKTAhF", - "Authorization": "zD61FNHI60" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 20 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum - 地质分层数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum") - - # 准备参数 - path_params = { - "dms_instance_code": "rkaQRAM42E" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum"]) - params = {} - headers = { - "Content-Type": "4CVyZd4LtB", - "Accept": "application/json", - "tenant-id": "32wNNeDLox", - "Authorization": "vUz7E1zb27" -} - body = { - "version": "L06Fgjtye8", - "data": [ - "ymwZs", - "PowVL" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version} - 地质分层数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "5M9GVqP85E", - "version": "2nkeEIbcoe" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "JXADYs2Qlk", - "Accept": "application/json", - "tenant-id": "reBVqFxrKt", - "Authorization": "4qJQFUIZ3m" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 22 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum - 地质分层数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum") - - # 准备参数 - path_params = { - "dms_instance_code": "WaI8LfN6yu" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum"]) - params = {} - headers = { - "Content-Type": "AJD6wrIC1y", - "Accept": "application/json", - "tenant-id": "Szt1XobWX5", - "Authorization": "dfr9vQFoCw" -} - body = { - "version": "1GPLJw1pEA", - "data": [ - "dTmNV" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version}/{id} - 地质分层数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "ohZnDcIF35", - "version": "zuq6BDBpt4", - "id": "zQ71nn4Mts" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "JY2dIF5wuJ", - "Accept": "application/json", - "tenant-id": "boeiS4VSlm", - "Authorization": "SPDWG9nUqa" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 64 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_bas_wellbore_stratum(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum - 地质分层数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_bas_wellbore_stratum") - - # 准备参数 - path_params = { - "dms_instance_code": "W14wzjQOBO" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_bas_wellbore_stratum"]) - params = {} - headers = { - "Content-Type": "wHdVQXvA8L", - "Accept": "application/json", - "tenant-id": "A3tISq5iWq", - "Authorization": "3n9AOIsdoT" -} - body = { - "version": "sr4oUUcthC", - "data": [ - "mXGru", - "Hkbwv" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_well_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_well/{version} - 井基本信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_well/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "yuQDhB0b3J", - "version": "C6X9swdm6T" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "SJIlS1Gmnj", - "Accept": "application/json", - "tenant-id": "NnQ4nkDqH5", - "Authorization": "RcMsC3VAUI" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 85 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_well(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_well - 井基本信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_well") - - # 准备参数 - path_params = { - "dms_instance_code": "yroknYsfn4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well"]) - params = {} - headers = { - "Content-Type": "dLPLAJoGt1", - "Accept": "application/json", - "tenant-id": "YZvoFKkFT8", - "Authorization": "qdiQOGQOWZ" -} - body = { - "version": "Dgmpej17D6", - "data": [ - "fkecj", - "hRFxP" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_well(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_well - 井基本信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_well") - - # 准备参数 - path_params = { - "dms_instance_code": "bEt6ATge7i" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well"]) - params = {} - headers = { - "Content-Type": "nz2sQDVw6n", - "Accept": "application/json", - "tenant-id": "m3A3BtNUEL", - "Authorization": "dv0aWYHyIq" -} - body = { - "version": "CYlo4yllkg", - "data": [ - "SnUbO" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_well(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_well - 井基本信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_well") - - # 准备参数 - path_params = { - "dms_instance_code": "EG1tTGvJPn" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well"]) - params = {} - headers = { - "Content-Type": "3XKjUO0id4", - "Accept": "application/json", - "tenant-id": "qYNodR28YD", - "Authorization": "udjFqUVxZx" -} - body = { - "version": "uZ26ZKhRZ3", - "data": [ - "mlHGM" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_well_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_well/{version}/{id} - 井基本信息查询详情-dsid""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_well/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "sAV45yhoKp", - "version": "A2zBmKoeNw", - "id": "ZTcLy3Wryg" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_well/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "TVm3y0ZFXH", - "Accept": "application/json", - "tenant-id": "Xe7vX82FCh", - "Authorization": "krkIjZ1joI" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 21 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_masterdata_cd_well_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/masterdata/cd_well/{version}/{id} - 基本信息查询详情-井ID""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/masterdata/cd_well/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "662AXZEMvZ", - "version": "hbRp6yNYni", - "id": "FQuEKRI7hh" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/masterdata/cd_well/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "cJ0vU3ghSZ", - "Accept": "application/json", - "tenant-id": "0x7a9m06UO", - "Authorization": "bLMstPY6im" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 73 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_naturalkey_cd_well_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/naturalkey/cd_well/{version} - 通过业务主键获取数据详情""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/naturalkey/cd_well/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "TpE42th4S4", - "version": "UjTmFW4LVo" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/naturalkey/cd_well/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "HLdmAYYhhj", - "Accept": "application/json", - "tenant-id": "MyAm51HL20", - "Authorization": "9MntrhbR5e" -} - - try: - # 发送请求 - response = self.session.post(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_event_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_event/{version} - 井作业阶段信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_event/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "18omMzHgne", - "version": "DEwJEjyZ50" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "uUFduuhKoH", - "Accept": "application/json", - "tenant-id": "DBLdRpjusg", - "Authorization": "B2X2XPBBxy" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 8 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_event_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_event/{version}/{id} - 井作业阶段查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_event/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "XxNXj892iR", - "version": "AbToKrINpF", - "id": "oCDr3CTCv4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "YdKMJ8ju3h", - "Accept": "application/json", - "tenant-id": "sZ2uF5D1SK", - "Authorization": "S6DidTKjPm" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 62 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_event(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_event - 井作业阶段数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_event") - - # 准备参数 - path_params = { - "dms_instance_code": "bB1BJznNWy" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event"]) - params = {} - headers = { - "Content-Type": "fB3gY6qfNJ", - "Accept": "application/json", - "tenant-id": "iRGi136j5y", - "Authorization": "N2ymAoIRFq" -} - body = { - "version": "l2YPfmLMSE", - "data": [ - "nNome", - "rxiAj", - "TmQxA" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_event(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_event - 井作业阶段数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_event") - - # 准备参数 - path_params = { - "dms_instance_code": "xzGknBeF9B" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event"]) - params = {} - headers = { - "Content-Type": "qv0X88IAp0", - "Accept": "application/json", - "tenant-id": "VHtOeiJgX4", - "Authorization": "mQYGERjuVO" -} - body = { - "version": "hvtmEBRN8X", - "data": [ - "gYRFO", - "CeQrv", - "KVAYA" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_event(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_event - 井作业阶段数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_event") - - # 准备参数 - path_params = { - "dms_instance_code": "sZHNB9L3iS" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_event"]) - params = {} - headers = { - "Content-Type": "TY5RBrb9Xl", - "Accept": "application/json", - "tenant-id": "xvrCstDMaS", - "Authorization": "oJhDn4WgJ4" -} - body = { - "version": "8OqdgSgbLA", - "data": [ - "MlfzB", - "AaNVd", - "XLPBE" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_organization(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_organization - 组织机构数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_organization") - - # 准备参数 - path_params = { - "dms_instance_code": "L9asftaNnr" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization"]) - params = {} - headers = { - "Content-Type": "pYo3c2n48u", - "Accept": "application/json", - "tenant-id": "QnTSb4C9Ow", - "Authorization": "DvjQ1EH2zC" -} - body = { - "version": "sZgTKoGNzf", - "data": [ - "sShYi" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_organization_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_organization/{version}/{id} - 组织机构查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_organization/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "Xyc4PXQAEL", - "version": "pkwzWNkWzJ", - "id": "tjVAMPF67u" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "vIOc2IhM4a", - "Accept": "application/json", - "tenant-id": "J097hLzAza", - "Authorization": "9ckyt2mXVM" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 68 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_organization(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_organization - 组织机构数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_organization") - - # 准备参数 - path_params = { - "dms_instance_code": "gCOc6sYbJH" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization"]) - params = {} - headers = { - "Content-Type": "eNm8tDyDfv", - "Accept": "application/json", - "tenant-id": "Hv78cdYXJ3", - "Authorization": "CHBhxvh3AK" -} - body = { - "version": "QhJqlTIBdI", - "data": [ - "cgbhg", - "nPzga" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_organization(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_organization - 组织机构数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_organization") - - # 准备参数 - path_params = { - "dms_instance_code": "7t6xeI4vTy" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization"]) - params = {} - headers = { - "Content-Type": "fqu8WrtMOc", - "Accept": "application/json", - "tenant-id": "mKxJ7Y7vNq", - "Authorization": "C9HqoEJ09a" -} - body = { - "version": "KrLtVYJmCQ", - "data": [ - "AUMTm" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_organization_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_organization/{version} - 组织机构信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_organization/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "6IXDCVgzY7", - "version": "grebADvLSv" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_organization/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "q00P9lkllt", - "Accept": "application/json", - "tenant-id": "g2O87WevgC", - "Authorization": "LPJf83UPRS" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 58 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_wellbore_zone_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version} - 小层分层数据列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "jESlPydB92", - "version": "YUs4rf11rk" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore_zone/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "Nck83pVntQ", - "Accept": "application/json", - "tenant-id": "K7ugjirgzF", - "Authorization": "TQlp7cydPX" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 31 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_wellbore_zone_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version}/{id} - 小层分层数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore_zone/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "7BzuzYLyov", - "version": "5QWgGgoJfQ", - "id": "rYm7NLv4K0" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore_zone/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "1dkcH9iNur", - "Accept": "application/json", - "tenant-id": "OYwJbES464", - "Authorization": "9Hy6nsCnc1" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 38 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_instance_code_v1_cd_wellbore_zone(self): - """测试 [POST] /api/{dms_instance_code}/v1/cd_wellbore_zone - 小层分层数据添加""" - logger.info(f"测试API: [POST] /api/{dms_instance_code}/v1/cd_wellbore_zone") - - # 准备参数 - path_params = { - "dms_instance_code": "YtvT7DNMmq" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/cd_wellbore_zone"]) - params = {} - headers = { - "Content-Type": "WfAYb6c2A7", - "Accept": "application/json", - "tenant-id": "hxJWyeI3ka", - "Authorization": "ltGkwrsrXJ" -} - body = { - "version": "NYgbbvcEcV", - "data": [ - "uyyFF", - "oUqsg", - "wQVrw" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_instance_code_v1_cd_wellbore_zone(self): - """测试 [PUT] /api/{dms_instance_code}/v1/cd_wellbore_zone - 小层分层数据修改""" - logger.info(f"测试API: [PUT] /api/{dms_instance_code}/v1/cd_wellbore_zone") - - # 准备参数 - path_params = { - "dms_instance_code": "vxBoWVfV79" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/cd_wellbore_zone"]) - params = {} - headers = { - "Content-Type": "Rhvd7AiTfo", - "Accept": "application/json", - "tenant-id": "FwyIhpxpeY", - "Authorization": "qaNZ0ru8HR" -} - body = { - "version": "3KCWr9LhFa", - "data": [ - "xbDmh", - "cYceq" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_instance_code_v1_cd_wellbore_zone(self): - """测试 [DELETE] /api/{dms_instance_code}/v1/cd_wellbore_zone - 小层分层数据删除""" - logger.info(f"测试API: [DELETE] /api/{dms_instance_code}/v1/cd_wellbore_zone") - - # 准备参数 - path_params = { - "dms_instance_code": "9UfJUVXzYi" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/cd_wellbore_zone"]) - params = {} - headers = { - "Content-Type": "yOJrU1Hj4y", - "Accept": "application/json", - "tenant-id": "ul2VPF1HVv", - "Authorization": "zUp3PkLvKM" -} - body = { - "version": "BMZzqpY6DP", - "data": [ - "YneRT" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ops_hp_mat_smpl_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version} - 高压物性取样列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "0HrrsaiVRH", - "version": "ChWfJOSKC7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "9B3QDxOI41", - "Accept": "application/json", - "tenant-id": "Mi8U5aVdvH", - "Authorization": "8eMvQftQFz" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 91 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_instance_code_v1_tp_ops_hp_mat_smpl(self): - """测试 [PUT] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl - 高压物性取样数据修改""" - logger.info(f"测试API: [PUT] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl") - - # 准备参数 - path_params = { - "dms_instance_code": "ZJ7L3cdioh" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl"]) - params = {} - headers = { - "Content-Type": "HUu98uOyqR", - "Accept": "application/json", - "tenant-id": "6cQjTtA9CV", - "Authorization": "kgu8Eteabr" -} - body = { - "version": "HJGPgPrh38", - "data": [ - "JHJkh" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_instance_code_v1_tp_ops_hp_mat_smpl(self): - """测试 [DELETE] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl - 高压物性取样数据删除""" - logger.info(f"测试API: [DELETE] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl") - - # 准备参数 - path_params = { - "dms_instance_code": "vmntQuQMyB" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl"]) - params = {} - headers = { - "Content-Type": "lA38lcQ3ha", - "Accept": "application/json", - "tenant-id": "azgvW1IIrR", - "Authorization": "uekzDpH9ws" -} - body = { - "version": "JEPsDLz4mt", - "data": [ - "uHsjB" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_instance_code_v1_tp_ops_hp_mat_smpl(self): - """测试 [POST] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl - 高压物性取样数据添加""" - logger.info(f"测试API: [POST] /api/{dms_instance_code}/v1/tp_ops_hp_mat_smpl") - - # 准备参数 - path_params = { - "dms_instance_code": "rpsIR8oVoa" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl"]) - params = {} - headers = { - "Content-Type": "HZDCNBawEj", - "Accept": "application/json", - "tenant-id": "bPUuVHDtMt", - "Authorization": "l6KqZ6WSeX" -} - body = { - "version": "egP6VeTmcA", - "data": [ - "WXxWU", - "oEQyr" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ops_hp_mat_smpl_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version}/{id} - 高压物性取样查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ops_hp_mat_smpl/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "PgTIwnC8ta", - "version": "ntiv5iEV7V", - "id": "pF5eHoONg4" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ops_hp_mat_smpl/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "FB55A4WisE", - "Accept": "application/json", - "tenant-id": "2SVHwopMQK", - "Authorization": "Rhtn4AHkkJ" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 24 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version} - 储集岩热解解释成果数据列表查询 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "YYsPQf38Wd", - "version": "xQSXRnudS7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "qN6RRWeAOz", - "Accept": "application/json", - "tenant-id": "lg82hxSkxu", - "Authorization": "6HSRJtedup" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 89 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp - 储集岩热解解释成果数据数据修改 """ - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "VympgtALI7" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp"]) - params = {} - headers = { - "Content-Type": "ll0m7E9NXr", - "Accept": "application/json", - "tenant-id": "6EKY5EFTeI", - "Authorization": "AX1vl0v1qQ" -} - body = { - "version": "LuvoQmpdyo", - "data": [ - "KqwDN", - "CxepS" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp - 储集岩热解解释成果数据数据删除 """ - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "JVpkAwDo87" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp"]) - params = {} - headers = { - "Content-Type": "1iQ3Zeg2lg", - "Accept": "application/json", - "tenant-id": "7gigg9zjn4", - "Authorization": "toWA3TOkGy" -} - body = { - "version": "YtrMF3PDQh", - "data": [ - "tgAcj", - "WewDy" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp - 储集岩热解解释成果数据数据添加 """ - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp") - - # 准备参数 - path_params = { - "dms_instance_code": "CX5ywFydeW" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp"]) - params = {} - headers = { - "Content-Type": "YM1OgWuFNb", - "Accept": "application/json", - "tenant-id": "bjnbzyuDm2", - "Authorization": "dcYXrtlqN8" -} - body = { - "version": "DXRluyomEm", - "data": [ - "Kblhf", - "ZNdUs" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_ml_ach_res_pyro_interp_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version}/{id} - 储集岩热解解释成果数据查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/ml_ach_res_pyro_interp/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "pIKdxggajA", - "version": "ewxOuliyW3", - "id": "7MOY0uTaMV" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/ml_ach_res_pyro_interp/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "3QTTQKGRaC", - "Accept": "application/json", - "tenant-id": "YYBzwACs9I", - "Authorization": "3d5heW0FYd" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 44 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_wellbore_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version} - 井筒基本信息列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "DhvWf3bzDi", - "version": "WCbCZ60Uyy" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "FOcTk1uqp5", - "Accept": "application/json", - "tenant-id": "071N4bBXfI", - "Authorization": "GX7rpDrrHI" -} - body = { - "isSearchCount": false, - "query": { - "key1": "value1", - "key2": 62 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_dms_instance_code_v1_cd_wellbore(self): - """测试 [PUT] /api/dms/{dms_instance_code}/v1/cd_wellbore - 井筒基本信息数据修改""" - logger.info(f"测试API: [PUT] /api/dms/{dms_instance_code}/v1/cd_wellbore") - - # 准备参数 - path_params = { - "dms_instance_code": "6HIr8LHdx9" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore"]) - params = {} - headers = { - "Content-Type": "G9Ctumb5S5", - "Accept": "application/json", - "tenant-id": "tNF1XEPcuc", - "Authorization": "7nFulgEpIA" -} - body = { - "version": "CS1SdL9WM1", - "data": [ - "GlyNY", - "MzVjk", - "wOLIc" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_dms_instance_code_v1_cd_wellbore(self): - """测试 [DELETE] /api/dms/{dms_instance_code}/v1/cd_wellbore - 井筒基本信息数据删除""" - logger.info(f"测试API: [DELETE] /api/dms/{dms_instance_code}/v1/cd_wellbore") - - # 准备参数 - path_params = { - "dms_instance_code": "UdmNJOG6Dt" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore"]) - params = {} - headers = { - "Content-Type": "YH5GY4MQGQ", - "Accept": "application/json", - "tenant-id": "oO8vS581Ty", - "Authorization": "Td3sioIbL9" -} - body = { - "version": "HxoQP0HWau", - "data": [ - "eidHI" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_cd_wellbore(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore - 井筒基本信息数据添加""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/cd_wellbore") - - # 准备参数 - path_params = { - "dms_instance_code": "8ufsW2j6kT" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore"]) - params = {} - headers = { - "Content-Type": "VERixUsnle", - "Accept": "application/json", - "tenant-id": "SjhNuPgJ4V", - "Authorization": "hXap7kNVpw" -} - body = { - "version": "oZVpIQ3hRX", - "data": [ - "OpZEY" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_cd_wellbore_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version}/{id} - 井筒基本信息查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/cd_wellbore/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "yA8Luqspi5", - "version": "24GhvShnSk", - "id": "XpylqDXImh" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/cd_wellbore/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "pp66quAALw", - "Accept": "application/json", - "tenant-id": "KlzXFXqXga", - "Authorization": "4U4AVhOZWy" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 17 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_dms_instance_code_v1_tp_ach_hp_mat_version(self): - """测试 [POST] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version} - 高压物性分析列表查询""" - logger.info(f"测试API: [POST] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version}") - - # 准备参数 - path_params = { - "dms_instance_code": "1gqb4n94Ls", - "version": "4sfnnIvZ0B" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_hp_mat/{path_params["version}"]"]) - params = {} - headers = { - "Content-Type": "wEt4cvcHFh", - "Accept": "application/json", - "tenant-id": "Lb8t7vclyj", - "Authorization": "0YuyHUO0iP" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 92 - } -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_put_api_dms_instance_code_v1_tp_ach_hp_mat(self): - """测试 [PUT] /api/{dms_instance_code}/v1/tp_ach_hp_mat - 高压物性分析数据修改""" - logger.info(f"测试API: [PUT] /api/{dms_instance_code}/v1/tp_ach_hp_mat") - - # 准备参数 - path_params = { - "dms_instance_code": "4TbrMhVO4H" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ach_hp_mat"]) - params = {} - headers = { - "Content-Type": "VMbDNO2H0C", - "Accept": "application/json", - "tenant-id": "kYJlT4CewH", - "Authorization": "oR6ENtyJKe" -} - body = { - "version": "80SdvT9IYT", - "data": [ - "FvfAc", - "bqsQX", - "zCIKo" - ] -} - - try: - # 发送请求 - response = self.session.put(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_delete_api_dms_instance_code_v1_tp_ach_hp_mat(self): - """测试 [DELETE] /api/{dms_instance_code}/v1/tp_ach_hp_mat - 高压物性分析数据删除""" - logger.info(f"测试API: [DELETE] /api/{dms_instance_code}/v1/tp_ach_hp_mat") - - # 准备参数 - path_params = { - "dms_instance_code": "suhoR0q7Pi" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ach_hp_mat"]) - params = {} - headers = { - "Content-Type": "0e9m75jXQB", - "Accept": "application/json", - "tenant-id": "NjnpJUD4hj", - "Authorization": "oar9MYAyzK" -} - body = { - "version": "K8lVZOfl06", - "field_1": "E7PfpYn8BT", - "data": [ - "hINau" - ] -} - - try: - # 发送请求 - response = self.session.delete(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_post_api_dms_instance_code_v1_tp_ach_hp_mat(self): - """测试 [POST] /api/{dms_instance_code}/v1/tp_ach_hp_mat - 高压物性分析数据添加""" - logger.info(f"测试API: [POST] /api/{dms_instance_code}/v1/tp_ach_hp_mat") - - # 准备参数 - path_params = { - "dms_instance_code": "La28dBlFzG" -} - url = self.base_url + f"/api/{path_params["dms_instance_code}/v1/tp_ach_hp_mat"]) - params = {} - headers = { - "Content-Type": "xqti6wOu7U", - "Accept": "application/json", - "tenant-id": "oCT1oLRcd8", - "Authorization": "ORctW5t3HT" -} - body = { - "version": "MAd7hVzK3P", - "data": [ - "IFpty", - "LXSxF" - ] -} - - try: - # 发送请求 - response = self.session.post(url, params=params, json=body, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - - - def test_get_api_dms_dms_instance_code_v1_tp_ach_hp_mat_version_id(self): - """测试 [GET] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version}/{id} - 高压物性分析查询详情""" - logger.info(f"测试API: [GET] /api/dms/{dms_instance_code}/v1/tp_ach_hp_mat/{version}/{id}") - - # 准备参数 - path_params = { - "dms_instance_code": "zDdLPsKA6K", - "version": "GMI0pDsbos", - "id": "sncQG9tVMU" -} - url = self.base_url + f"/api/dms/{path_params["dms_instance_code}/v1/tp_ach_hp_mat/{path_params["version}/{path_params["id}"]"]"]) - params = {} - headers = { - "Content-Type": "kENnw9cC1T", - "Accept": "application/json", - "tenant-id": "EaeoSMSddA", - "Authorization": "qFbvJhPgiU" -} - body = { - "isSearchCount": true, - "query": { - "key1": "value1", - "key2": 44 - } -} - - try: - # 发送请求 - response = self.session.get(url, params=params, headers=headers, timeout=10) - - # 输出响应信息 - logger.info(f"状态码: {response.status_code}") - logger.info(f"响应内容: {format_response(response)}") - - # 验证响应 - validate_response(response) - - except Exception as e: - logger.error(f"测试失败: {str(e)}") - raise - diff --git a/tests/test_json_schema_validator.py b/tests/test_json_schema_validator.py deleted file mode 100644 index 189f243..0000000 --- a/tests/test_json_schema_validator.py +++ /dev/null @@ -1,232 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -JSON Schema Validator Test Module - -Unit tests for ddms_compliance_suite.json_schema_validator.validator module, -validates JSON data against schema definitions. -""" - -import os -import sys -import unittest -import json -from unittest import mock -from pathlib import Path - -# Add project root to Python path -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -# Import classes and functions to test -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator -from ddms_compliance_suite.models.rule_models import JSONSchemaDefinition, RuleCategory, TargetType - -class TestJSONSchemaValidator(unittest.TestCase): - """JSON Schema Validator Test Class""" - - def setUp(self): - """Setup before tests""" - # Create validator instance - self.validator = JSONSchemaValidator() - - # Test schema definition - self.well_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["wellName", "wellID", "status", "coordinates"], - "properties": { - "wellName": { - "type": "string", - "description": "Well name" - }, - "wellID": { - "type": "string", - "pattern": "^W[0-9]{10}$", - "description": "Well unique identifier, must be W followed by 10 digits" - }, - "status": { - "type": "string", - "enum": ["active", "inactive", "abandoned", "suspended"], - "description": "Current well status" - }, - "coordinates": { - "type": "object", - "required": ["longitude", "latitude"], - "properties": { - "longitude": { - "type": "number", - "minimum": -180, - "maximum": 180, - "description": "Longitude coordinate" - }, - "latitude": { - "type": "number", - "minimum": -90, - "maximum": 90, - "description": "Latitude coordinate" - } - } - } - } - } - - # Create a schema rule - self.schema_rule = JSONSchemaDefinition( - id="well-data-schema", - name="Well Data Schema", - description="Defines JSON structure for well data", - category=RuleCategory.JSON_SCHEMA, - version="1.0.0", - target_type=TargetType.DATA_OBJECT, - target_identifier="Well", - schema_content=self.well_schema - ) - - def test_valid_data(self): - """Test that valid data passes validation""" - # Valid test data - valid_data = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - # Validate - result = self.validator.validate(valid_data, self.well_schema) - - # Assert - self.assertTrue(result.is_valid) - self.assertEqual(len(result.errors), 0) - - def test_missing_required_field(self): - """Test missing required field scenario""" - # Data missing required field - invalid_data = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - # Missing status field - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - # Validate - result = self.validator.validate(invalid_data, self.well_schema) - - # Assert - self.assertFalse(result.is_valid) - self.assertTrue(any("status" in error for error in result.errors)) - - def test_invalid_pattern(self): - """Test field with invalid pattern""" - # Data with invalid wellID format - invalid_data = { - "wellName": "Test Well-01", - "wellID": "ABCDEFGHIJK", # Does not match W + 10 digits pattern - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - # Validate - result = self.validator.validate(invalid_data, self.well_schema) - - # Assert - self.assertFalse(result.is_valid) - self.assertTrue(any("pattern" in error for error in result.errors)) - - def test_invalid_enum(self): - """Test value not in enum""" - # Data with status not in enum list - invalid_data = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - "status": "unknown", # Not in enum list - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - # Validate - result = self.validator.validate(invalid_data, self.well_schema) - - # Assert - self.assertFalse(result.is_valid) - self.assertTrue(any("enum" in error for error in result.errors)) - - def test_invalid_number_range(self): - """Test number out of range""" - # Data with longitude out of range - invalid_data = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - "status": "active", - "coordinates": { - "longitude": 200.0, # Outside [-180, 180] range - "latitude": 39.9167 - } - } - - # Validate - result = self.validator.validate(invalid_data, self.well_schema) - - # Assert - self.assertFalse(result.is_valid) - self.assertTrue(any("maximum" in error for error in result.errors)) - - def test_validate_with_rule(self): - """Test validation using rule object""" - # Valid test data - valid_data = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - # Validate using rule object - result = self.validator.validate_with_rule(valid_data, self.schema_rule) - - # Assert - self.assertTrue(result.is_valid) - self.assertEqual(len(result.errors), 0) - - def test_additional_properties(self): - """Test handling of additional properties""" - # Create a schema that prohibits additional properties - strict_schema = dict(self.well_schema) - strict_schema["additionalProperties"] = False - - # Data with extra property - data_with_extra = { - "wellName": "Test Well-01", - "wellID": "W0123456789", - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - }, - "extra_field": "Extra Field" # Extra field - } - - # Validate - result = self.validator.validate(data_with_extra, strict_schema) - - # Assert - self.assertFalse(result.is_valid) - self.assertTrue(any("additionalProperties" in error for error in result.errors)) - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_live_seismic_api.py b/tests/test_live_seismic_api.py deleted file mode 100644 index c380d84..0000000 --- a/tests/test_live_seismic_api.py +++ /dev/null @@ -1,521 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -实时地震体 API 集成测试 - -本测试模块验证连接到真实运行的地震体 API 服务(端口5001), -使用 API 调用器和 JSON Schema 验证器对其响应进行验证。 -""" - -import sys -import os -import unittest -import json -import logging -import requests -from pathlib import Path - -# 添加项目根目录到 Python 路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator -from ddms_compliance_suite.models.rule_models import JSONSchemaDefinition, RuleCategory, TargetType - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger(__name__) - -# API 服务器地址 -LIVE_API_SERVER = "http://localhost:5001" - -class TestLiveSeismicAPI(unittest.TestCase): - """实时地震体 API 集成测试类""" - - @classmethod - def setUpClass(cls): - """测试类开始前检查API服务器是否可用""" - cls.server_available = False - try: - # 使用简单的健康检查请求来测试服务器是否运行 - response = requests.get(f"{LIVE_API_SERVER}/", timeout=2) - # 模拟服务器可能返回404,但只要能连接就说明服务器在运行 - cls.server_available = True - logger.info("API服务器可用,将执行集成测试") - except (requests.ConnectionError, requests.Timeout): - logger.warning(f"无法连接到API服务器 {LIVE_API_SERVER},集成测试将被跳过") - cls.server_available = False - - def setUp(self): - """测试前的设置""" - # 如果服务器不可用,跳过所有测试 - if not self.__class__.server_available: - self.skipTest(f"API服务器 {LIVE_API_SERVER} 不可用") - - # 创建 API 调用器实例 - self.api_caller = APICaller( - default_timeout=30, - default_headers={"Content-Type": "application/json"} - ) - - # 创建 JSON Schema 验证器实例 - self.schema_validator = JSONSchemaValidator() - - # 用于添加新地震体和验证响应的 JSON Schema - self.add_seismic_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["code", "flag", "msg", "result"], - "properties": { - "code": {"type": ["string", "integer"]}, # 允许整数或字符串类型 - "flag": {"type": "boolean"}, - "msg": {"type": "string"}, - "result": {"type": ["string", "null", "object"]} # 允许字符串、空或对象类型 - } - } - - # 地震体数据的 JSON Schema - self.seismic_data_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["projectId", "surveyId", "seismicName", "dsType", "dimensions"], - "properties": { - "projectId": { - "type": "string", - "description": "项目ID" - }, - "surveyId": { - "type": "string", - "description": "测量ID" - }, - "seismicName": { - "type": "string", - "description": "地震体名称" - }, - "dsType": { - "type": "integer", - "enum": [1, 2], - "description": "数据集类型: 1 为基础地震体, 2 为属性体" - }, - "dimensions": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": ["dimensionNo", "dimensionName", "serviceMin", "serviceMax"], - "properties": { - "dimensionNo": { - "type": "integer", - "minimum": 1, - "description": "维度编号" - }, - "dimensionName": { - "type": "string", - "description": "维度名称" - }, - "serviceMin": { - "type": "integer", - "description": "最小值" - }, - "serviceMax": { - "type": "integer", - "description": "最大值" - }, - "serviceSpan": { - "type": "integer", - "description": "采样间隔" - } - } - } - } - }, - "allOf": [ - { - "if": { - "properties": { "dsType": { "enum": [2] } }, - "required": ["dsType"] - }, - "then": { - "required": ["baseSeismicId"], - "properties": { - "baseSeismicId": { - "type": "string", - "description": "属性体必须的基础地震体标识符" - } - } - } - } - ] - } - - # 创建一个新的地震体ID存储 - self.created_seismic_ids = [] - - def test_0_health_check(self): - """测试服务器健康状态""" - # 此测试主要用于确认服务器是否正常运行 - # 即使返回404,只要能连接就视为服务器可用 - try: - response = requests.get(f"{LIVE_API_SERVER}/health", timeout=2) - logger.info(f"服务器健康检查响应: {response.status_code}") - self.assertTrue(True, "服务器可用") - except (requests.ConnectionError, requests.Timeout) as e: - self.fail(f"无法连接到API服务器: {str(e)}") - - def test_1_add_valid_seismic_file(self): - """测试添加有效的地震体文件""" - # 创建有效的地震体数据 - valid_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "有效地震体", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - # 验证请求数据满足架构 - request_validation = self.schema_validator.validate( - valid_seismic_data, - self.seismic_data_schema - ) - self.assertTrue(request_validation.is_valid, f"请求数据不符合架构: {request_validation.errors}") - - # 创建 API 请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=valid_seismic_data - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合 Schema - validation_result = self.schema_validator.validate( - response.json_content, - self.add_seismic_schema - ) - - # 断言 - self.assertTrue(validation_result.is_valid, f"响应数据不符合架构: {validation_result.errors}") - self.assertTrue(response.json_content.get("flag", False)) - - # 保存创建的地震体ID,用于后续测试 - seismic_id = response.json_content.get("result") - if seismic_id: - self.created_seismic_ids.append(seismic_id) - logger.info(f"创建了地震体ID: {seismic_id}") - except Exception as e: - logger.error(f"测试添加有效地震体文件失败: {str(e)}") - raise - - def test_2_add_attribute_body(self): - """测试添加属性体""" - # 确保有至少一个地震体ID可用于测试 - # 获取已知存在的样例地震体 - sample_seismic_id = "20221113181927_1" - - # 创建属性体数据 - attribute_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "测试属性体", - "dsType": 2, # dsType 为 2 表示属性体 - "baseSeismicId": sample_seismic_id, # 引用已知存在的基础地震体ID - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - # 验证请求数据满足架构 - request_validation = self.schema_validator.validate( - attribute_seismic_data, - self.seismic_data_schema - ) - self.assertTrue(request_validation.is_valid, f"请求数据不符合架构: {request_validation.errors}") - - # 创建 API 请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=attribute_seismic_data - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合 Schema - validation_result = self.schema_validator.validate( - response.json_content, - self.add_seismic_schema - ) - - # 断言 - self.assertTrue(validation_result.is_valid, f"响应数据不符合架构: {validation_result.errors}") - self.assertTrue(response.json_content.get("flag", False)) - - # 保存创建的地震体ID,用于后续测试 - seismic_id = response.json_content.get("result") - if seismic_id: - self.created_seismic_ids.append(seismic_id) - logger.info(f"创建了属性体ID: {seismic_id}") - except Exception as e: - logger.error(f"测试添加属性体失败: {str(e)}") - raise - - def test_3_trace_count(self): - """测试查询地震体总道数""" - # 使用已知存在的样例地震体ID - sample_seismic_id = "20221113181927_1" - - # 创建查询道数的请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/traces/count", - body={"seismicId": sample_seismic_id} - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应格式 - self.assertIn("result", response.json_content) - self.assertIn("code", response.json_content) - self.assertIn("msg", response.json_content) - - # 即使道数为0也是有效响应 - logger.info(f"地震体 {sample_seismic_id} 的道数: {response.json_content.get('result')}") - except Exception as e: - logger.error(f"测试查询地震体总道数失败: {str(e)}") - raise - - def test_4_export_task(self): - """测试导出地震体任务提交""" - # 使用已知存在的样例地震体ID - sample_seismic_id = "20221113181927_1" - - # 创建提交导出任务的请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/export/submit", - body={ - "seismicId": sample_seismic_id, - "saveDir": f"/export/{sample_seismic_id}.sgy" - } - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应 - self.assertEqual(response.json_content.get("code"), "0") - self.assertTrue(response.json_content.get("flag", False)) - self.assertIn("result", response.json_content) - - # 获取任务ID - task_id = None - result = response.json_content.get("result") - if isinstance(result, dict) and "taskId" in result: - task_id = result.get("taskId") - - self.assertIsNotNone(task_id, "未能获取导出任务ID") - logger.info(f"创建了导出任务ID: {task_id}") - - # 检查导出任务进度 - if task_id: - # 创建查询进度的请求 - progress_request = APIRequest( - method="GET", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/export/progress?taskId={task_id}" - ) - - # 调用 API - progress_response = self.api_caller.call_api(progress_request) - - # 验证 API 调用结果 - self.assertEqual(progress_response.status_code, 200) - self.assertIsNotNone(progress_response.json_content) - - # 验证响应 - self.assertEqual(progress_response.json_content.get("code"), "0") - self.assertTrue(progress_response.json_content.get("flag", False)) - progress_result = progress_response.json_content.get("result", {}) - self.assertIn("status", progress_result) - self.assertIn("progress", progress_result) - - logger.info(f"导出任务 {task_id} 状态: {progress_result.get('status')}, 进度: {progress_result.get('progress')}%") - except Exception as e: - logger.error(f"测试导出地震体任务提交失败: {str(e)}") - raise - - def test_5_h3200_header(self): - """测试查询地震体3200头""" - # 使用已知存在的样例地震体ID - sample_seismic_id = "20221113181927_1" - - # 创建查询3200头的请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/head/h3200", - body={"seismicId": sample_seismic_id} - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - 成功返回二进制数据 - self.assertEqual(response.status_code, 200) - # 不是JSON响应,应该是二进制数据 - self.assertIsNotNone(response.content) - - logger.info(f"地震体 {sample_seismic_id} 的3200头数据长度: {len(response.content)}") - except Exception as e: - logger.error(f"测试查询地震体3200头失败: {str(e)}") - raise - - def test_6_h400_keywords(self): - """测试查询地震体卷头关键字信息""" - # 使用已知存在的样例地震体ID - sample_seismic_id = "20221113181927_1" - - # 创建查询卷头关键字的请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/h400/keyword/list", - body={"seismicId": sample_seismic_id} - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应 - self.assertTrue(response.json_content.get("flag", False)) - - # 验证响应中包含关键字列表 - self.assertIn("result", response.json_content) - - logger.info(f"地震体 {sample_seismic_id} 的卷头关键字数量: {len(response.json_content.get('result', []))}") - except Exception as e: - logger.error(f"测试查询地震体卷头关键字信息失败: {str(e)}") - raise - - def test_7_coordinate_conversion(self): - """测试查询地震体点线坐标""" - # 使用已知存在的样例地震体ID - sample_seismic_id = "20221113181927_1" - - # 测试点坐标 - test_points = [ - [606406.1281141682, 6082083.338731234], # 模拟服务器样例中的一个坐标 - [609767.8725899048, 6080336.549935018], - [615271.9052119441, 6082017.422172886] - ] - - # 创建坐标转换请求 - request = APIRequest( - method="POST", - url=f"{LIVE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/coordinate/geodetic/toline", - body={ - "seismicId": sample_seismic_id, - "points": test_points - } - ) - - try: - # 调用 API - response = self.api_caller.call_api(request) - - # 验证 API 调用结果 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应 - self.assertEqual(response.json_content.get("code"), 0) - self.assertIn("result", response.json_content) - - # 验证返回的结果是否与测试点一一对应 - result = response.json_content.get("result", []) - self.assertEqual(len(result), len(test_points)) - - # 记录转换结果 - for i, (point, line_point) in enumerate(zip(test_points, result)): - logger.info(f"坐标点 {i+1}: {point} → 线点: {line_point}") - except Exception as e: - logger.error(f"测试查询地震体点线坐标失败: {str(e)}") - raise - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_load_schema_from_file.py b/tests/test_load_schema_from_file.py deleted file mode 100644 index 6522858..0000000 --- a/tests/test_load_schema_from_file.py +++ /dev/null @@ -1,213 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -测试从文件加载 JSON Schema 功能 - -这个测试脚本验证系统能够正确地从文件系统加载 JSON Schema 定义, -并使用这些 Schema 进行数据验证。 -""" - -import sys -import os -import unittest -import json -import logging -from pathlib import Path - -# 添加项目根目录到 Python 路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator -from ddms_compliance_suite.rule_repository.repository import RuleRepository -from ddms_compliance_suite.models.config_models import RuleRepositoryConfig -from ddms_compliance_suite.models.rule_models import TargetType - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger(__name__) - -class TestLoadSchemaFromFile(unittest.TestCase): - """测试从文件加载 JSON Schema 功能""" - - def setUp(self): - """测试前的设置""" - # 创建规则仓库配置 - config = RuleRepositoryConfig( - storage={"type": "filesystem", "path": "./rules"}, - preload_rules=True - ) - - # 初始化规则仓库 - self.rule_repository = RuleRepository(config) - - # 创建 JSON Schema 验证器 - self.schema_validator = JSONSchemaValidator() - - def test_load_well_schema(self): - """测试加载井数据 Schema""" - # 从仓库加载 Schema - well_schema = self.rule_repository.get_schema_for_target( - TargetType.API_RESPONSE, "getWellData" - ) - - # 验证 Schema 是否已加载 - self.assertIsNotNone(well_schema, "无法加载井数据 Schema") - self.assertIsInstance(well_schema, dict, "Schema 不是字典类型") - self.assertIn("properties", well_schema, "Schema 缺少 properties 字段") - - # 验证 Schema 中的必要字段 - self.assertIn("wellName", well_schema["properties"], "Schema 缺少 wellName 字段") - self.assertIn("wellID", well_schema["properties"], "Schema 缺少 wellID 字段") - - logger.info("成功加载井数据 Schema") - - # 测试使用加载的 Schema 验证数据 - valid_data = { - "wellName": "测试井-01", - "wellID": "W0123456789", - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - result = self.schema_validator.validate(valid_data, well_schema) - self.assertTrue(result.is_valid, f"验证失败: {result.errors}") - - # 测试无效数据 - invalid_data = { - "wellName": "测试井-01", - # 缺少 wellID - "status": "active", - "coordinates": { - "longitude": 116.3833, - "latitude": 39.9167 - } - } - - result = self.schema_validator.validate(invalid_data, well_schema) - self.assertFalse(result.is_valid, "验证应该失败但成功了") - self.assertGreater(len(result.errors), 0, "应该有验证错误") - - def test_load_seismic_schema(self): - """测试加载地震体数据 Schema""" - # 从仓库加载 Schema - seismic_schema = self.rule_repository.get_schema_for_target( - TargetType.DATA_OBJECT, "Seismic" - ) - - # 验证 Schema 是否已加载 - self.assertIsNotNone(seismic_schema, "无法加载地震体数据 Schema") - self.assertIsInstance(seismic_schema, dict, "Schema 不是字典类型") - self.assertIn("properties", seismic_schema, "Schema 缺少 properties 字段") - - # 验证 Schema 中的必要字段 - self.assertIn("projectId", seismic_schema["properties"], "Schema 缺少 projectId 字段") - self.assertIn("dimensions", seismic_schema["properties"], "Schema 缺少 dimensions 字段") - - logger.info("成功加载地震体数据 Schema") - - # 测试使用加载的 Schema 验证数据 - valid_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "西部地震体-01", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - } - - result = self.schema_validator.validate(valid_data, seismic_schema) - self.assertTrue(result.is_valid, f"验证失败: {result.errors}") - - # 测试无效数据 - 缺少必要字段 - invalid_data = { - "projectId": "testPrj1", - # 缺少 surveyId - "seismicName": "西部地震体-01", - "dsType": 1 - # 缺少 dimensions - } - - result = self.schema_validator.validate(invalid_data, seismic_schema) - self.assertFalse(result.is_valid, "验证应该失败但成功了") - self.assertGreater(len(result.errors), 0, "应该有验证错误") - - # 测试属性体无效数据 - 缺少 baseSeismicId - invalid_attribute_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "属性体", - "dsType": 2, # 属性体类型 - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - # 缺少 baseSeismicId - } - - result = self.schema_validator.validate(invalid_attribute_data, seismic_schema) - self.assertFalse(result.is_valid, "属性体验证应该失败但成功了") - self.assertGreater(len(result.errors), 0, "应该有验证错误") - - def test_load_api_response_schema(self): - """测试加载 API 响应 Schema""" - # 从仓库加载 Schema - api_schema = self.rule_repository.get_schema_for_target( - TargetType.API_RESPONSE, "SeismicAPIResponse" - ) - - # 验证 Schema 是否已加载 - self.assertIsNotNone(api_schema, "无法加载 API 响应 Schema") - self.assertIsInstance(api_schema, dict, "Schema 不是字典类型") - self.assertIn("properties", api_schema, "Schema 缺少 properties 字段") - - # 验证 Schema 中的必要字段 - self.assertIn("code", api_schema["properties"], "Schema 缺少 code 字段") - self.assertIn("flag", api_schema["properties"], "Schema 缺少 flag 字段") - self.assertIn("msg", api_schema["properties"], "Schema 缺少 msg 字段") - - logger.info("成功加载 API 响应 Schema") - - # 测试使用加载的 Schema 验证数据 - valid_data = { - "code": "0", - "flag": True, - "msg": "操作成功", - "result": "20230601123456_1" - } - - result = self.schema_validator.validate(valid_data, api_schema) - self.assertTrue(result.is_valid, f"验证失败: {result.errors}") - - # 测试无效数据 - invalid_data = { - "code": "0", - "flag": True, - # 缺少 msg - "result": "20230601123456_1" - } - - result = self.schema_validator.validate(invalid_data, api_schema) - self.assertFalse(result.is_valid, "验证应该失败但成功了") - self.assertGreater(len(result.errors), 0, "应该有验证错误") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_remote_seismic_api.py b/tests/test_remote_seismic_api.py deleted file mode 100644 index 027a3d1..0000000 --- a/tests/test_remote_seismic_api.py +++ /dev/null @@ -1,238 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -远程地震体 API 集成测试 - -本测试模块连接到用户在5001端口启动的远程地震体API服务, -测试API调用器和JSON Schema验证器与外部API服务的集成。 -""" - -import os -import sys -import json -import logging -import unittest -import requests -from pathlib import Path - -# 添加项目根目录到 Python 路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest, APIResponse -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger(__name__) - -# 远程API服务器地址 -REMOTE_API_SERVER = "http://localhost:5001" - -class TestRemoteSeismicAPI(unittest.TestCase): - """远程地震体 API 集成测试类""" - - @classmethod - def setUpClass(cls): - """测试类开始前检查API服务器是否可用""" - cls.server_available = False - cls.server_endpoints = [] - - try: - # 尝试连接到服务器,只要能连接就认为服务器在运行 - response = requests.get(f"{REMOTE_API_SERVER}/", timeout=2) - cls.server_available = True - logger.info(f"远程API服务器 {REMOTE_API_SERVER} 可访问,HTTP状态码: {response.status_code}") - - # 尝试列出所有可用的端点(通常在开发环境中有帮助) - try: - routes_response = requests.get(f"{REMOTE_API_SERVER}/api/routes", timeout=2) - if routes_response.status_code == 200: - cls.server_endpoints = routes_response.json() - logger.info(f"服务器提供了 {len(cls.server_endpoints)} 个端点") - else: - # 如果服务器不支持自省,查询几个关键端点确认API类型 - for endpoint in [ - "/api/gsc/appmodel/api/v1/seismic/file/list", - "/api/gsc/appmodel/api/v1/seismic/traces/count" - ]: - try: - endpoint_response = requests.head(f"{REMOTE_API_SERVER}{endpoint}", timeout=1) - if endpoint_response.status_code not in (404, 405): # 405是方法不允许,表示端点存在 - cls.server_endpoints.append(endpoint) - except Exception: - pass - - if cls.server_endpoints: - logger.info(f"检测到地震体API服务器,可访问的端点: {cls.server_endpoints}") - except Exception as e: - logger.warning(f"无法列出服务器端点: {str(e)}") - except Exception as e: - logger.warning(f"无法连接到远程API服务器 {REMOTE_API_SERVER}: {str(e)}") - cls.server_available = False - - def setUp(self): - """为每个测试初始化环境""" - if not self.__class__.server_available: - self.skipTest(f"远程API服务器 {REMOTE_API_SERVER} 不可用") - - # 创建API调用器 - self.api_caller = APICaller( - default_timeout=10, - default_headers={"Content-Type": "application/json"} - ) - - # 创建JSON Schema验证器 - self.schema_validator = JSONSchemaValidator() - - # 保存测试中创建的资源ID,以便后续测试或清理 - self.created_resource_ids = [] - - def test_api_connection(self): - """测试与API服务器的基本连接""" - # 选择一个简单的端点进行测试,或尝试服务器根目录 - try: - response = requests.get(f"{REMOTE_API_SERVER}/", timeout=2) - # 只要能连接,不管返回什么状态码,测试都通过 - self.assertTrue(True, "成功连接到API服务器") - logger.info(f"服务器连接测试成功,HTTP状态码: {response.status_code}") - except Exception as e: - self.fail(f"连接到API服务器失败: {str(e)}") - - def test_create_seismic_file(self): - """测试创建地震体文件""" - # 准备创建地震体的请求数据 - seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "远程测试地震体", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=seismic_data - ) - - try: - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - logger.info(f"创建地震体API调用返回状态码: {response.status_code}") - - # 如果API服务器接受请求,保存响应用于进一步测试 - if 200 <= response.status_code < 300 and response.json_content: - # 响应可能包含更多字段,但至少应该有一个ID标识新创建的资源 - if "result" in response.json_content: - created_id = response.json_content.get("result") - if created_id: - self.created_resource_ids.append(created_id) - logger.info(f"成功创建地震体,ID: {created_id}") - else: - logger.warning("API响应中的result字段为空") - else: - logger.warning(f"API响应中没有result字段: {response.json_content}") - else: - logger.warning(f"API调用未返回成功状态码或JSON内容: {response.status_code}, {response.content}") - except Exception as e: - logger.error(f"创建地震体过程中发生错误: {str(e)}") - # 不触发测试失败,只记录错误,因为这是探索性测试 - - def test_query_sample_seismic(self): - """查询样例地震体信息""" - # 使用预定义的样例ID,通常由服务器在启动时创建 - sample_id = "20221113181927_1" - - # 尝试对这个ID进行多种查询操作 - self._try_query_trace_count(sample_id) - self._try_query_h3200(sample_id) - self._try_query_h400_keywords(sample_id) - - def _try_query_trace_count(self, seismic_id): - """尝试查询地震体道数""" - request = APIRequest( - method="POST", - url=f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/traces/count", - body={"seismicId": seismic_id} - ) - - try: - response = self.api_caller.call_api(request) - logger.info(f"查询道数API调用返回状态码: {response.status_code}") - - if 200 <= response.status_code < 300 and response.json_content: - result = response.json_content.get("result", "未知") - logger.info(f"地震体 {seismic_id} 的道数: {result}") - except Exception as e: - logger.warning(f"查询道数失败: {str(e)}") - - def _try_query_h3200(self, seismic_id): - """尝试查询地震体3200头""" - request = APIRequest( - method="POST", - url=f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/head/h3200", - body={"seismicId": seismic_id} - ) - - try: - response = self.api_caller.call_api(request) - logger.info(f"查询3200头API调用返回状态码: {response.status_code}") - - if 200 <= response.status_code < 300: - if response.content: - logger.info(f"地震体 {seismic_id} 的3200头数据长度: {len(response.content)} 字节") - except Exception as e: - logger.warning(f"查询3200头失败: {str(e)}") - - def _try_query_h400_keywords(self, seismic_id): - """尝试查询地震体卷头关键字""" - request = APIRequest( - method="POST", - url=f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/h400/keyword/list", - body={"seismicId": seismic_id} - ) - - try: - response = self.api_caller.call_api(request) - logger.info(f"查询卷头关键字API调用返回状态码: {response.status_code}") - - if 200 <= response.status_code < 300 and response.json_content: - keywords = response.json_content.get("result", []) - logger.info(f"地震体 {seismic_id} 的卷头关键字数量: {len(keywords)}") - if keywords: - logger.info(f"第一个关键字: {keywords[0]}") - except Exception as e: - logger.warning(f"查询卷头关键字失败: {str(e)}") - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_remote_seismic_api_direct.py b/tests/test_remote_seismic_api_direct.py deleted file mode 100644 index b56e912..0000000 --- a/tests/test_remote_seismic_api_direct.py +++ /dev/null @@ -1,311 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -远程地震体 API 直接测试 - -使用 requests 库直接调用远程地震体 API 服务, -不通过 APICaller 类,以测试基本功能。 -""" - -import os -import sys -import json -import logging -import unittest -import requests -from pathlib import Path - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger(__name__) - -# 远程API服务器地址 -REMOTE_API_SERVER = "http://localhost:5001" - -class TestRemoteSeismicAPIDirect(unittest.TestCase): - """远程地震体 API 直接测试类""" - - @classmethod - def setUpClass(cls): - """测试类开始前检查API服务器是否可用""" - cls.server_available = False - - try: - # 尝试连接到服务器,只要能连接就认为服务器在运行 - response = requests.get(f"{REMOTE_API_SERVER}/", timeout=2) - cls.server_available = True - logger.info(f"远程API服务器 {REMOTE_API_SERVER} 可访问,HTTP状态码: {response.status_code}") - except Exception as e: - logger.warning(f"无法连接到远程API服务器 {REMOTE_API_SERVER}: {str(e)}") - cls.server_available = False - - def setUp(self): - """为每个测试初始化环境""" - if not self.__class__.server_available: - self.skipTest(f"远程API服务器 {REMOTE_API_SERVER} 不可用") - - # 保存测试中创建的资源ID,以便后续测试或清理 - self.created_resource_ids = [] - - def test_create_seismic_file(self): - """测试创建地震体文件""" - # 准备创建地震体的请求数据 - seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "测试地震体-直接调用", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - try: - # 直接使用requests库调用API - response = requests.post( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - json=seismic_data, - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - logger.info(f"创建地震体API调用返回状态码: {response.status_code}") - - # 解析响应JSON - response_json = response.json() - self.assertIn("result", response_json) - - # 保存创建的ID用于后续测试 - created_id = response_json.get("result") - if created_id: - self.created_resource_ids.append(created_id) - logger.info(f"成功创建地震体,ID: {created_id}") - - # 验证响应的其他字段 - self.assertEqual(response_json.get("code"), "0") - self.assertTrue(response_json.get("flag", False)) - except Exception as e: - logger.error(f"创建地震体过程中发生错误: {str(e)}") - raise - - def test_query_trace_count(self): - """测试查询地震体道数""" - # 使用样例ID - sample_id = "20221113181927_1" - - try: - # 直接使用requests库调用API - response = requests.post( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/traces/count", - json={"seismicId": sample_id}, - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - logger.info(f"查询道数API调用返回状态码: {response.status_code}") - - # 解析响应JSON - response_json = response.json() - self.assertIn("result", response_json) - self.assertIn("code", response_json) - self.assertIn("msg", response_json) - - trace_count = response_json.get("result") - logger.info(f"地震体 {sample_id} 的道数: {trace_count}") - except Exception as e: - logger.error(f"查询道数过程中发生错误: {str(e)}") - raise - - def test_query_h3200_header(self): - """测试查询地震体3200头""" - # 使用样例ID - sample_id = "20221113181927_1" - - try: - # 直接使用requests库调用API - response = requests.post( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/head/h3200", - json={"seismicId": sample_id}, - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - logger.info(f"查询3200头API调用返回状态码: {response.status_code}") - - # 验证返回了二进制数据 - self.assertTrue(len(response.content) > 0) - logger.info(f"地震体 {sample_id} 的3200头数据长度: {len(response.content)} 字节") - except Exception as e: - logger.error(f"查询3200头过程中发生错误: {str(e)}") - raise - - def test_query_h400_keywords(self): - """测试查询地震体卷头关键字列表""" - # 使用样例ID - sample_id = "20221113181927_1" - - try: - # 直接使用requests库调用API - response = requests.post( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/h400/keyword/list", - json={"seismicId": sample_id}, - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - logger.info(f"查询卷头关键字API调用返回状态码: {response.status_code}") - - # 解析响应JSON - response_json = response.json() - self.assertIn("result", response_json) - self.assertTrue(response_json.get("flag", False)) - - keywords = response_json.get("result", []) - logger.info(f"地震体 {sample_id} 的卷头关键字数量: {len(keywords)}") - if keywords: - logger.info(f"第一个关键字: {keywords[0]}") - except Exception as e: - logger.error(f"查询卷头关键字过程中发生错误: {str(e)}") - raise - - def test_coordinate_conversion(self): - """测试坐标转换""" - # 使用样例ID - sample_id = "20221113181927_1" - - # 测试点坐标 - test_points = [ - [606406.1281141682, 6082083.338731234], # 模拟服务器样例中的一个坐标 - [609767.8725899048, 6080336.549935018], - [615271.9052119441, 6082017.422172886] - ] - - try: - # 直接使用requests库调用API - response = requests.post( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/coordinate/geodetic/toline", - json={ - "seismicId": sample_id, - "points": test_points - }, - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - logger.info(f"坐标转换API调用返回状态码: {response.status_code}") - - # 解析响应JSON - response_json = response.json() - self.assertIn("result", response_json) - - result = response_json.get("result", []) - self.assertEqual(len(result), len(test_points)) - - # 记录转换结果 - for i, (point, line_point) in enumerate(zip(test_points, result)): - logger.info(f"坐标点 {i+1}: {point} → 线点: {line_point}") - except Exception as e: - logger.error(f"坐标转换过程中发生错误: {str(e)}") - raise - - def test_export_task(self): - """测试导出地震体任务""" - # 使用样例ID - sample_id = "20221113181927_1" - - try: - # 1. 提交导出任务 - submit_response = requests.post( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/export/submit", - json={ - "seismicId": sample_id, - "saveDir": f"/export/{sample_id}.sgy" - }, - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(submit_response.status_code, 200) - logger.info(f"提交导出任务API调用返回状态码: {submit_response.status_code}") - - # 解析响应JSON - submit_json = submit_response.json() - self.assertEqual(submit_json.get("code"), "0") - self.assertTrue(submit_json.get("flag", False)) - self.assertIn("result", submit_json) - - # 获取任务ID - task_result = submit_json.get("result", {}) - if isinstance(task_result, dict) and "taskId" in task_result: - task_id = task_result["taskId"] - else: - task_id = task_result # 某些实现可能直接返回任务ID - - self.assertIsNotNone(task_id, "导出任务ID不应为空") - logger.info(f"创建导出任务成功,任务ID: {task_id}") - - # 2. 查询导出进度 - if task_id: - progress_response = requests.get( - f"{REMOTE_API_SERVER}/api/gsc/appmodel/api/v1/seismic/export/progress?taskId={task_id}", - headers={"Content-Type": "application/json"}, - timeout=10 - ) - - # 验证响应状态码 - self.assertEqual(progress_response.status_code, 200) - logger.info(f"查询导出进度API调用返回状态码: {progress_response.status_code}") - - # 解析响应JSON - progress_json = progress_response.json() - self.assertEqual(progress_json.get("code"), "0") - self.assertTrue(progress_json.get("flag", False)) - - # 验证进度信息 - progress_result = progress_json.get("result", {}) - if isinstance(progress_result, dict): - self.assertIn("status", progress_result) - self.assertIn("progress", progress_result) - logger.info(f"导出任务 {task_id} 状态: {progress_result.get('status')}, 进度: {progress_result.get('progress')}%") - except Exception as e: - logger.error(f"导出任务测试过程中发生错误: {str(e)}") - raise - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_seismic_api_integration.py b/tests/test_seismic_api_integration.py deleted file mode 100644 index 8b4b236..0000000 --- a/tests/test_seismic_api_integration.py +++ /dev/null @@ -1,566 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -地震体模拟API集成测试 - -本测试模块验证与地震体模拟API服务器的集成测试, -确保API调用器和JSON Schema验证器能够正确处理地震体数据API。 -""" - -import sys -import os -import unittest -import json -import logging -import time -import subprocess -from pathlib import Path -import threading - -# 添加项目根目录到Python路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger(__name__) - -# API服务器地址 -MOCK_API_SERVER = "http://localhost:5001" - -class TestSeismicAPIIntegration(unittest.TestCase): - """地震体模拟API集成测试类""" - - @classmethod - def setUpClass(cls): - """在所有测试前启动模拟API服务器""" - # 尝试启动模拟服务器 - cls.server_process = None - cls.server_running = False - - try: - # 检查服务器是否已经在运行 - import requests - try: - response = requests.get(f"{MOCK_API_SERVER}/", timeout=0.5) - cls.server_running = True - logger.info("模拟API服务器已经在运行") - except: - # 服务器没有运行,需要启动 - logger.info("正在启动模拟API服务器...") - - # 启动模拟服务器的线程 - def run_server(): - try: - project_root = Path(__file__).resolve().parents[1] - process = subprocess.Popen( - [sys.executable, '-m', 'tests.run_mock_seismic_api'], - cwd=str(project_root), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE - ) - cls.server_process = process - logger.info("模拟API服务器启动成功!") - except Exception as e: - logger.error(f"启动模拟API服务器失败: {str(e)}") - - # 在后台线程中启动服务器 - server_thread = threading.Thread(target=run_server) - server_thread.daemon = True - server_thread.start() - - # 等待服务器启动 - max_retries = 10 - retry_count = 0 - while retry_count < max_retries: - try: - time.sleep(1) # 等待一秒 - response = requests.get(f"{MOCK_API_SERVER}/", timeout=0.5) - cls.server_running = True - logger.info("模拟API服务器已启动并可用") - break - except: - retry_count += 1 - logger.info(f"等待模拟API服务器启动... ({retry_count}/{max_retries})") - - if not cls.server_running: - logger.warning("无法确认模拟API服务器是否成功启动") - except Exception as e: - logger.error(f"设置模拟API服务器时出错: {str(e)}") - - @classmethod - def tearDownClass(cls): - """在所有测试结束后关闭模拟API服务器""" - if cls.server_process: - try: - cls.server_process.terminate() - cls.server_process.wait(timeout=5) - logger.info("模拟API服务器已关闭") - except Exception as e: - logger.error(f"关闭模拟API服务器时出错: {str(e)}") - - def setUp(self): - """测试前的设置""" - # 如果服务器未运行,跳过测试 - if not self.__class__.server_running: - self.skipTest("模拟API服务器未运行") - - # 创建API调用器 - self.api_caller = APICaller( - default_timeout=10, - default_headers={"Content-Type": "application/json"} - ) - - # 创建JSON Schema验证器 - self.schema_validator = JSONSchemaValidator() - - # 地震体数据的JSON Schema - self.seismic_data_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["projectId", "surveyId", "seismicName", "dsType", "dimensions"], - "properties": { - "projectId": { - "type": "string", - "description": "项目ID" - }, - "surveyId": { - "type": "string", - "description": "测量ID" - }, - "seismicName": { - "type": "string", - "description": "地震体名称" - }, - "dsType": { - "type": "integer", - "enum": [1, 2], - "description": "数据集类型: 1 为基础地震体, 2 为属性体" - }, - "dimensions": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": ["dimensionNo", "dimensionName", "serviceMin", "serviceMax"], - "properties": { - "dimensionNo": { - "type": "integer", - "minimum": 1, - "description": "维度编号" - }, - "dimensionName": { - "type": "string", - "description": "维度名称" - }, - "serviceMin": { - "type": "integer", - "description": "最小值" - }, - "serviceMax": { - "type": "integer", - "description": "最大值" - }, - "serviceSpan": { - "type": "integer", - "description": "采样间隔" - } - } - } - } - }, - "allOf": [ - { - "if": { - "properties": { "dsType": { "enum": [2] } }, - "required": ["dsType"] - }, - "then": { - "required": ["baseSeismicId"], - "properties": { - "baseSeismicId": { - "type": "string", - "description": "属性体必须的基础地震体标识符" - } - } - } - } - ] - } - - # API响应的JSON Schema - self.api_response_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "code": {"type": ["string", "integer"]}, - "flag": {"type": "boolean"}, - "msg": {"type": "string"}, - "result": {} # 允许任何类型的结果 - } - } - - # 测试数据集 - self.valid_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "西部地震体-01", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ] - } - - self.attribute_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "振幅属性体", - "dsType": 2, - "baseSeismicId": "20221113181927_1", # 假设这是有效的基础地震体ID - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - } - ] - } - - self.invalid_seismic_data = { - "projectId": "testPrj1", - "seismicName": "缺少必填字段", - "dsType": 1, # 缺少 surveyId - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - } - - # 存储测试过程中创建的资源ID - self.created_resources = [] - - def test_server_connection(self): - """测试与模拟服务器的连接""" - import requests - try: - response = requests.get(f"{MOCK_API_SERVER}/", timeout=2) - # 即使状态码是404,但只要能连接到服务器就算成功 - logger.info(f"服务器连接测试 - 状态码: {response.status_code}") - self.assertTrue(True, "成功连接到模拟API服务器") - except Exception as e: - self.fail(f"连接到模拟API服务器失败: {str(e)}") - - def test_add_valid_seismic_file(self): - """测试添加有效的地震体文件""" - # 先验证数据结构符合Schema - validation_result = self.schema_validator.validate( - self.valid_seismic_data, - self.seismic_data_schema - ) - self.assertTrue(validation_result.is_valid, f"数据验证失败: {validation_result.errors}") - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=self.valid_seismic_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合Schema - response_validation = self.schema_validator.validate( - response.json_content, - self.api_response_schema - ) - self.assertTrue(response_validation.is_valid, f"响应验证失败: {response_validation.errors}") - - # 验证业务逻辑 - self.assertTrue(response.json_content.get("flag", False)) - self.assertEqual(response.json_content.get("code"), "0") - - # 保存创建的资源ID - result_id = response.json_content.get("result") - if result_id: - self.created_resources.append(result_id) - logger.info(f"创建地震体成功,ID: {result_id}") - - def test_add_attribute_seismic_file(self): - """测试添加属性体文件""" - # 先验证数据结构符合Schema - validation_result = self.schema_validator.validate( - self.attribute_seismic_data, - self.seismic_data_schema - ) - self.assertTrue(validation_result.is_valid, f"数据验证失败: {validation_result.errors}") - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=self.attribute_seismic_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合Schema - response_validation = self.schema_validator.validate( - response.json_content, - self.api_response_schema - ) - self.assertTrue(response_validation.is_valid, f"响应验证失败: {response_validation.errors}") - - # 验证业务逻辑 - self.assertTrue(response.json_content.get("flag", False)) - self.assertEqual(response.json_content.get("code"), "0") - - # 保存创建的资源ID - result_id = response.json_content.get("result") - if result_id: - self.created_resources.append(result_id) - logger.info(f"创建属性体成功,ID: {result_id}") - - def test_add_invalid_seismic_file(self): - """测试添加无效的地震体文件""" - # 先验证数据结构不符合Schema - validation_result = self.schema_validator.validate( - self.invalid_seismic_data, - self.seismic_data_schema - ) - self.assertFalse(validation_result.is_valid, "无效数据居然通过了Schema验证") - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=self.invalid_seismic_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 注意:模拟服务器可能不严格执行验证,此处仅验证API调用能够成功完成 - logger.info(f"添加无效地震体返回: {response.json_content}") - - def test_query_trace_count(self): - """测试查询地震体道数""" - # 使用预定义的样例ID - sample_id = "20221113181927_1" - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/traces/count", - body={"seismicId": sample_id} - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 模拟服务器可能返回不同格式的响应,此处仅检查API调用成功 - logger.info(f"查询道数响应: {response.json_content}") - - # 验证结果包含信息(可能是数字或其他) - self.assertIn("result", response.json_content) - result = response.json_content.get("result") - logger.info(f"地震体 {sample_id} 的道数: {result}") - - def test_coordinate_conversion(self): - """测试坐标转换""" - # 使用预定义的样例ID和坐标点 - sample_id = "20221113181927_1" - test_points = [ - [606406.1281141682, 6082083.338731234], - [609767.8725899048, 6080336.549935018], - [615271.9052119441, 6082017.422172886] - ] - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/coordinate/geodetic/toline", - body={ - "seismicId": sample_id, - "points": test_points - } - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 模拟服务器可能有不同的响应格式,记录响应信息 - logger.info(f"坐标转换响应: {response.json_content}") - - # 验证结果包含信息 - self.assertIn("result", response.json_content) - result = response.json_content.get("result", []) - - # 记录转换结果 - logger.info(f"坐标转换结果: {result}") - - def test_export_task(self): - """测试导出地震体任务""" - # 使用预定义的样例ID - sample_id = "20221113181927_1" - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/export/submit", - body={ - "seismicId": sample_id, - "saveDir": f"/export/{sample_id}.sgy" - } - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合Schema - response_validation = self.schema_validator.validate( - response.json_content, - self.api_response_schema - ) - self.assertTrue(response_validation.is_valid, f"响应验证失败: {response_validation.errors}") - - # 验证业务逻辑 - self.assertTrue(response.json_content.get("flag", False)) - self.assertEqual(response.json_content.get("code"), "0") - - # 验证结果包含任务ID - result = response.json_content.get("result", {}) - task_id = None - if isinstance(result, dict) and "taskId" in result: - task_id = result.get("taskId") - else: - task_id = result # 某些实现可能直接返回任务ID - - self.assertIsNotNone(task_id, "任务ID不应为空") - logger.info(f"导出任务ID: {task_id}") - - # 查询任务进度 - if task_id: - # 等待一小段时间以确保任务已经开始处理 - time.sleep(0.5) - - # 创建API请求 - progress_request = APIRequest( - method="GET", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/export/progress?taskId={task_id}" - ) - - # 调用API - progress_response = self.api_caller.call_api(progress_request) - - # 验证响应状态码 - self.assertEqual(progress_response.status_code, 200) - self.assertIsNotNone(progress_response.json_content) - - # 验证业务逻辑 - self.assertTrue(progress_response.json_content.get("flag", False)) - - # 验证结果包含进度信息 - progress_result = progress_response.json_content.get("result", {}) - self.assertIn("status", progress_result) - self.assertIn("progress", progress_result) - - logger.info(f"导出任务 {task_id} 状态: {progress_result.get('status')}, 进度: {progress_result.get('progress')}%") - - def test_h400_keywords(self): - """测试查询地震体卷头关键字""" - # 使用预定义的样例ID - sample_id = "20221113181927_1" - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/h400/keyword/list", - body={"seismicId": sample_id} - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应状态码 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 记录响应信息 - logger.info(f"卷头关键字响应: {response.json_content}") - - # 验证结果包含关键字列表 - self.assertIn("result", response.json_content) - keywords = response.json_content.get("result", []) - logger.info(f"地震体 {sample_id} 的卷头关键字数量: {len(keywords)}") - if isinstance(keywords, list) and keywords: - logger.info(f"第一个关键字: {keywords[0]}") - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_seismic_schema_validation.py b/tests/test_seismic_schema_validation.py deleted file mode 100644 index 050d818..0000000 --- a/tests/test_seismic_schema_validation.py +++ /dev/null @@ -1,517 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -地震体数据Schema验证和API集成测试 - -测试地震体数据的Schema验证和API调用的集成, -确保Schema验证器和API调用器能够协同工作,正确处理地震体数据。 -""" - -import sys -import os -import unittest -import json -import logging -from pathlib import Path -from unittest import mock - -# 添加项目根目录到Python路径 -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from ddms_compliance_suite.api_caller.caller import APICaller, APIRequest, APIResponse -from ddms_compliance_suite.json_schema_validator.validator import JSONSchemaValidator -from ddms_compliance_suite.rule_repository.repository import RuleRepository -from ddms_compliance_suite.models.config_models import RuleRepositoryConfig -from ddms_compliance_suite.models.rule_models import TargetType - -# 配置日志 -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' -) -logger = logging.getLogger(__name__) - -# 模拟API服务器 -MOCK_API_SERVER = "http://localhost:5001" - -class MockResponse: - """模拟API响应对象""" - - def __init__(self, status_code, data=None, content=None, headers=None, elapsed_time=0.1): - self.status_code = status_code - self.data = data - self.content = content if content is not None else (json.dumps(data).encode() if data else b'') - self.headers = headers or {"Content-Type": "application/json"} - self.elapsed = mock.Mock() - self.elapsed.total_seconds.return_value = elapsed_time - - def json(self): - """获取JSON内容""" - if isinstance(self.data, dict): - return self.data - raise ValueError("Response does not contain valid JSON") - - -class TestSeismicSchemaValidation(unittest.TestCase): - """地震体数据Schema验证和API集成测试类""" - - def setUp(self): - """测试前的设置""" - # 创建规则仓库 - config = RuleRepositoryConfig( - storage={"type": "filesystem", "path": "./rules"}, - preload_rules=True - ) - self.rule_repository = RuleRepository(config) - - # 创建JSON Schema验证器 - self.schema_validator = JSONSchemaValidator() - - # 创建API调用器 - self.api_caller = APICaller( - default_timeout=10, - default_headers={"Content-Type": "application/json"} - ) - - # 从规则仓库加载Schema - self.seismic_data_schema = self.rule_repository.get_schema_for_target( - TargetType.DATA_OBJECT, "Seismic" - ) - if not self.seismic_data_schema: - self.fail("无法加载地震体数据Schema,请确保rules/json_schemas/seismic-data-schema目录中存在有效的Schema文件") - - # 从规则仓库加载API响应Schema - self.api_response_schema = self.rule_repository.get_schema_for_target( - TargetType.API_RESPONSE, "SeismicAPIResponse" - ) - if not self.api_response_schema: - logger.warning("无法加载API响应Schema,将使用默认定义") - # 默认的API响应Schema - self.api_response_schema = { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": ["code", "flag", "msg", "result"], - "properties": { - "code": {"type": ["string", "integer"]}, - "flag": {"type": "boolean"}, - "msg": {"type": "string"}, - "result": {"type": ["string", "null", "object"]} - } - } - - # 测试数据集 - self.valid_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "西部地震体-01", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - }, - { - "dimensionNo": 3, - "dimensionName": "slice", - "serviceMin": 3500, - "serviceMax": 3600, - "serviceSpan": 4 - } - ], - "sampleRate": 2.0, - "dataRange": { - "min": -10000, - "max": 10000 - }, - "coordinates": [ - [116.3833, 39.9167], - [116.4024, 39.9008], - [116.4100, 39.9200] - ] - } - - self.attribute_seismic_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "振幅属性体", - "dsType": 2, - "baseSeismicId": "20221113181927_1", - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 2, - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - } - ], - "sampleRate": 2.0, - "dataRange": { - "min": 0, - "max": 255 - } - } - - self.invalid_dimension_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "错误维度地震体", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 500, - "serviceMax": 100, # 最小值大于最大值,应该报错 - "serviceSpan": 1 - } - ] - } - - self.duplicate_dimension_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "重复维度地震体", - "dsType": 1, - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - }, - { - "dimensionNo": 1, # 重复的维度编号 - "dimensionName": "xline", - "serviceMin": 200, - "serviceMax": 600, - "serviceSpan": 1 - } - ] - } - - self.missing_required_data = { - "projectId": "testPrj1", - "seismicName": "缺少必填字段", - "dsType": 1, # 缺少 surveyId - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - } - - self.missing_baseid_data = { - "projectId": "testPrj1", - "surveyId": "20230117135924_2", - "seismicName": "缺少基础ID的属性体", - "dsType": 2, # 属性体类型,但缺少 baseSeismicId - "dimensions": [ - { - "dimensionNo": 1, - "dimensionName": "inline", - "serviceMin": 100, - "serviceMax": 500, - "serviceSpan": 1 - } - ] - } - - # 模拟API响应 - self.mock_success_response = { - "code": "0", - "flag": True, - "msg": "操作成功", - "result": "20230601123456_1" - } - - self.mock_error_response = { - "code": "1", - "flag": False, - "msg": "操作失败:缺少必填字段", - "result": None - } - - def test_schema_loaded_from_file(self): - """测试从文件加载Schema""" - self.assertIsNotNone(self.seismic_data_schema, "地震体数据Schema未加载") - self.assertIsInstance(self.seismic_data_schema, dict, "地震体数据Schema不是字典类型") - self.assertIn("properties", self.seismic_data_schema, "地震体数据Schema缺少properties字段") - self.assertIn("dimensions", self.seismic_data_schema["properties"], "地震体数据Schema缺少dimensions属性") - - logger.info("成功从文件加载地震体数据Schema") - - self.assertIsNotNone(self.api_response_schema, "API响应Schema未加载") - self.assertIsInstance(self.api_response_schema, dict, "API响应Schema不是字典类型") - self.assertIn("properties", self.api_response_schema, "API响应Schema缺少properties字段") - self.assertIn("code", self.api_response_schema["properties"], "API响应Schema缺少code属性") - - logger.info("成功加载API响应Schema") - - @mock.patch('ddms_compliance_suite.api_caller.caller.requests.request') - def test_valid_seismic_data_validation(self, mock_request): - """测试验证有效的地震体数据""" - # 使用Schema验证器验证数据 - validation_result = self.schema_validator.validate( - self.valid_seismic_data, - self.seismic_data_schema - ) - - # 断言验证结果 - self.assertTrue(validation_result.is_valid, f"验证失败: {validation_result.errors}") - self.assertEqual(len(validation_result.errors), 0) - self.assertEqual(len(validation_result.warnings), 0) - - # 配置模拟请求 - mock_response = MockResponse(200, self.mock_success_response) - mock_request.return_value = mock_response - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=self.valid_seismic_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证模拟方法被调用 - mock_request.assert_called_once() - - # 验证响应 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合Schema - response_validation = self.schema_validator.validate( - response.json_content, - self.api_response_schema - ) - - # 断言API响应验证 - self.assertTrue(response_validation.is_valid, f"API响应验证失败: {response_validation.errors}") - self.assertEqual(response.json_content["code"], "0") - self.assertTrue(response.json_content["flag"]) - - @mock.patch('ddms_compliance_suite.api_caller.caller.requests.request') - def test_attribute_seismic_data_validation(self, mock_request): - """测试验证属性体数据""" - # 使用Schema验证器验证数据 - validation_result = self.schema_validator.validate( - self.attribute_seismic_data, - self.seismic_data_schema - ) - - # 断言验证结果 - self.assertTrue(validation_result.is_valid, f"验证失败: {validation_result.errors}") - self.assertEqual(len(validation_result.errors), 0) - - # 配置模拟请求 - mock_response = MockResponse(200, self.mock_success_response) - mock_request.return_value = mock_response - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=self.attribute_seismic_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应 - self.assertEqual(response.status_code, 200) - self.assertTrue(response.json_content["flag"]) - - def test_invalid_dimension_validation(self): - """测试维度参数无效的验证""" - # 使用Schema验证器验证数据 - validation_result = self.schema_validator.validate( - self.invalid_dimension_data, - self.seismic_data_schema - ) - - # 基本Schema验证不会检查 serviceMin < serviceMax,这需要额外验证逻辑 - # 因此这个测试仅检查基本结构符合Schema - self.assertTrue(validation_result.is_valid) - - # 所以在这里我们可以补充一个额外的业务逻辑验证 - for dimension in self.invalid_dimension_data["dimensions"]: - if dimension["serviceMin"] > dimension["serviceMax"]: - # 在实际代码中,这应该添加到验证结果的错误列表中 - logger.error(f"维度 {dimension['dimensionName']} 的最小值({dimension['serviceMin']})大于最大值({dimension['serviceMax']})") - validation_result.is_valid = False - validation_result.errors.append(f"维度{dimension['dimensionNo']}的最小值不能大于最大值") - - # 断言最终的验证结果 - self.assertFalse(validation_result.is_valid) - self.assertGreater(len(validation_result.errors), 0) - - def test_duplicate_dimension_validation(self): - """测试重复维度编号的验证""" - # 使用Schema验证器验证数据 - validation_result = self.schema_validator.validate( - self.duplicate_dimension_data, - self.seismic_data_schema - ) - - # 基本Schema验证不会检查重复的dimensionNo,这需要额外验证逻辑 - self.assertTrue(validation_result.is_valid) - - # 实现额外的检查 - dimension_nos = [dim["dimensionNo"] for dim in self.duplicate_dimension_data["dimensions"]] - if len(dimension_nos) != len(set(dimension_nos)): - # 在实际代码中,这应该添加到验证结果的错误列表中 - logger.error(f"存在重复的维度编号: {dimension_nos}") - validation_result.is_valid = False - validation_result.errors.append("维度编号不能重复") - - # 断言最终的验证结果 - self.assertFalse(validation_result.is_valid) - self.assertGreater(len(validation_result.errors), 0) - - def test_missing_required_field_validation(self): - """测试缺少必填字段的验证""" - # 使用Schema验证器验证数据 - validation_result = self.schema_validator.validate( - self.missing_required_data, - self.seismic_data_schema - ) - - # 断言验证结果 - self.assertFalse(validation_result.is_valid) - self.assertGreater(len(validation_result.errors), 0) - - # 检查错误消息是否包含缺少的字段 - has_missing_field_error = any("surveyId" in error for error in validation_result.errors) - self.assertTrue(has_missing_field_error, f"错误消息中没有包含缺少的surveyId字段: {validation_result.errors}") - - def test_missing_baseid_for_attribute_validation(self): - """测试缺少基础地震体ID的属性体验证""" - # 使用Schema验证器验证数据 - validation_result = self.schema_validator.validate( - self.missing_baseid_data, - self.seismic_data_schema - ) - - # 断言验证结果 - self.assertFalse(validation_result.is_valid) - self.assertGreater(len(validation_result.errors), 0) - - # 检查错误消息是否包含缺少的基础地震体ID - has_missing_baseid_error = any("baseSeismicId" in error for error in validation_result.errors) - self.assertTrue(has_missing_baseid_error, f"错误消息中没有包含缺少的baseSeismicId: {validation_result.errors}") - - @mock.patch('ddms_compliance_suite.api_caller.caller.requests.request') - def test_api_error_response_validation(self, mock_request): - """测试API错误响应的验证""" - # 配置模拟请求返回错误响应 - mock_response = MockResponse(200, self.mock_error_response) - mock_request.return_value = mock_response - - # 创建API请求 - 使用缺少必填字段的数据 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=self.missing_required_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证模拟方法被调用 - mock_request.assert_called_once() - - # 验证响应 - self.assertEqual(response.status_code, 200) - self.assertIsNotNone(response.json_content) - - # 验证响应符合Schema但标志为失败 - response_validation = self.schema_validator.validate( - response.json_content, - self.api_response_schema - ) - - # 断言API响应验证 - self.assertTrue(response_validation.is_valid, f"API响应验证失败: {response_validation.errors}") - self.assertEqual(response.json_content["code"], "1") - self.assertFalse(response.json_content["flag"]) - - @mock.patch('ddms_compliance_suite.api_caller.caller.requests.request') - def test_schema_and_api_integration(self, mock_request): - """测试Schema验证和API调用的完整集成""" - test_cases = [ - (self.valid_seismic_data, True, self.mock_success_response), - (self.attribute_seismic_data, True, self.mock_success_response), - (self.missing_required_data, False, self.mock_error_response), - (self.missing_baseid_data, False, self.mock_error_response) - ] - - for seismic_data, expected_valid, api_response in test_cases: - # 1. 验证Schema - validation_result = self.schema_validator.validate( - seismic_data, - self.seismic_data_schema - ) - - # 断言Schema验证结果符合预期 - self.assertEqual(validation_result.is_valid, expected_valid, - f"Schema验证结果与预期不符: {seismic_data.get('seismicName', 'Unknown')}") - - # 2. 如果Schema验证通过,调用API - if validation_result.is_valid: - # 配置模拟请求 - mock_response = MockResponse(200, api_response) - mock_request.return_value = mock_response - - # 创建API请求 - request = APIRequest( - method="POST", - url=f"{MOCK_API_SERVER}/api/gsc/appmodel/api/v1/seismic/file/add", - body=seismic_data - ) - - # 调用API - response = self.api_caller.call_api(request) - - # 验证响应 - self.assertEqual(response.status_code, 200) - self.assertEqual(response.json_content["flag"], api_response["flag"]) - - # 验证响应符合Schema - response_validation = self.schema_validator.validate( - response.json_content, - self.api_response_schema - ) - - # 断言API响应验证 - self.assertTrue(response_validation.is_valid) - - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/tests/test_test_case_registry.py b/tests/test_test_case_registry.py new file mode 100644 index 0000000..33a054f --- /dev/null +++ b/tests/test_test_case_registry.py @@ -0,0 +1,325 @@ +import unittest +import os +import shutil +import logging +from typing import List + +# 调整导入路径以适应测试文件在 tests/ 目录下的情况 +# 我们假设 tests/ 和 ddms_compliance_suite/ 在同一级别 (项目根目录下) +import sys +# 获取当前文件 (test_test_case_registry.py) 的目录 (tests/) +current_file_dir = os.path.dirname(os.path.abspath(__file__)) +# 获取项目根目录 (tests/ 的上一级) +project_root = os.path.dirname(current_file_dir) +# 将项目根目录添加到 sys.path 中,以便可以找到 ddms_compliance_suite 包 +if project_root not in sys.path: + sys.path.insert(0, project_root) + +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +from ddms_compliance_suite.test_case_registry import TestCaseRegistry + +# 为了测试,我们需要一个临时的测试用例目录 +TEMP_TEST_CASES_DIR = os.path.join(current_file_dir, "temp_custom_testcases_for_registry_test") + +# 禁用 TestCaseRegistry 和 BaseAPITestCase 在测试期间的 INFO 和 DEBUG 日志,除非特意捕获 +# logging.getLogger("ddms_compliance_suite.test_case_registry").setLevel(logging.WARNING) +# logging.getLogger("testcase").setLevel(logging.WARNING) # BaseAPITestCase uses testcase. + +class TestTestCaseRegistry(unittest.TestCase): + + def setUp(self): + """在每个测试方法运行前创建临时测试用例目录。""" + if os.path.exists(TEMP_TEST_CASES_DIR): + shutil.rmtree(TEMP_TEST_CASES_DIR) + os.makedirs(TEMP_TEST_CASES_DIR) + self.registry = None # 确保每个测试都重新初始化registry + + def tearDown(self): + """在每个测试方法运行后清理临时测试用例目录。""" + if os.path.exists(TEMP_TEST_CASES_DIR): + shutil.rmtree(TEMP_TEST_CASES_DIR) + + def _create_test_case_file(self, filename: str, content: str): + """辅助方法,在临时目录中创建测试用例文件。""" + with open(os.path.join(TEMP_TEST_CASES_DIR, filename), "w", encoding="utf-8") as f: + f.write(content) + + def test_init_with_non_existent_dir(self): + """测试使用不存在的目录初始化 TestCaseRegistry。""" + non_existent_dir = os.path.join(TEMP_TEST_CASES_DIR, "_i_do_not_exist_") + with self.assertLogs(level='WARNING') as log_watcher: + registry = TestCaseRegistry(test_cases_dir=non_existent_dir) + self.assertTrue(any(f"测试用例目录不存在或不是一个目录: {non_existent_dir}" in msg for msg in log_watcher.output)) + self.assertEqual(len(registry.get_all_test_case_classes()), 0) + + def test_init_with_empty_dir(self): + """测试使用空的目录初始化 TestCaseRegistry。""" + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + self.assertEqual(len(registry.get_all_test_case_classes()), 0) + # 应该有一条INFO日志表明发现完成且数量为0 + + def test_discover_single_valid_test_case(self): + """测试发现单个有效的测试用例。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class MyTest(BaseAPITestCase): + id = "TC-001" + name = "Test Case 1" + description = "Desc 1" + severity = TestSeverity.HIGH + tags = ["tag1"] +""" + self._create_test_case_file("test_001.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + all_cases = registry.get_all_test_case_classes() + self.assertEqual(len(all_cases), 1) + self.assertEqual(all_cases[0].id, "TC-001") + self.assertIsNotNone(registry.get_test_case_by_id("TC-001")) + + def test_discover_multiple_test_cases_in_one_file(self): + """测试在单个文件中发现多个测试用例。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class TestA(BaseAPITestCase): + id = "TC-A" + name = "A" +class TestB(BaseAPITestCase): + id = "TC-B" + name = "B" +""" + self._create_test_case_file("test_ab.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + all_cases = registry.get_all_test_case_classes() + self.assertEqual(len(all_cases), 2) + self.assertIsNotNone(registry.get_test_case_by_id("TC-A")) + self.assertIsNotNone(registry.get_test_case_by_id("TC-B")) + # 确保顺序与文件中定义的顺序(或至少是可预测的)一致,inspect.getmembers 通常按字母顺序 + ids = sorted([case.id for case in all_cases]) + self.assertEqual(ids, ["TC-A", "TC-B"]) + + def test_discover_test_cases_in_multiple_files(self): + """测试在多个文件中发现测试用例。""" + content1 = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class Test1(BaseAPITestCase): + id = "TC-1" +""" + content2 = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class Test2(BaseAPITestCase): + id = "TC-2" +""" + self._create_test_case_file("file1.py", content1) + self._create_test_case_file("file2.py", content2) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + all_cases = registry.get_all_test_case_classes() + self.assertEqual(len(all_cases), 2) + self.assertIsNotNone(registry.get_test_case_by_id("TC-1")) + self.assertIsNotNone(registry.get_test_case_by_id("TC-2")) + + def test_ignore_non_py_files_and_dunder_files(self): + """测试忽略非.py文件和以__开头的文件。""" + self._create_test_case_file("not_a_test.txt", "text content") + self._create_test_case_file("__init__.py", "# I am an init file") + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class RealTest(BaseAPITestCase): + id = "TC-REAL" +""" + self._create_test_case_file("real_test.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + all_cases = registry.get_all_test_case_classes() + self.assertEqual(len(all_cases), 1) + self.assertEqual(all_cases[0].id, "TC-REAL") + + def test_handle_import_error_in_test_file(self): + """测试处理测试用例文件中的导入错误。""" + content = "import non_existent_module\n" # This will cause ImportError + self._create_test_case_file("importerror_test.py", content) + with self.assertLogs(level='ERROR') as log_watcher: + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + self.assertTrue(any("导入模块 'importerror_test' 从" in msg and "失败" in msg for msg in log_watcher.output)) + self.assertEqual(len(registry.get_all_test_case_classes()), 0) + + def test_handle_attribute_error_missing_id(self): + """测试处理测试用例类缺少 'id' 属性的情况。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class MissingIdTest(BaseAPITestCase): + name = "Missing ID" + # id is missing +""" + self._create_test_case_file("missing_id.py", content) + # AttributeError is caught by the generic Exception in discover_test_cases if not directly handled + # It might also depend on when/how inspect.getmembers tries to access obj.id + # Forcing access here to ensure the test scenario is valid if discovery itself doesn't raise it immediately + with self.assertLogs(level='ERROR') as log_watcher: + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + # The error log in discover_test_cases for AttributeError on obj.id might be tricky to assert precisely + # We'll check that no test cases were loaded from this problematic file, but other files might load. + self.assertTrue(any("在模块 'missing_id'" in msg and "查找测试用例时出错" in msg for msg in log_watcher.output), + msg=f"Did not find expected error log. Logs: {log_watcher.output}") + # Ensure no test cases are registered if the only file has this error + self.assertEqual(len(registry.get_all_test_case_classes()), 0) + + + def test_duplicate_test_case_id(self): + """测试发现重复的测试用例 ID。""" + content1 = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class TestOne(BaseAPITestCase): + id = "DUPLICATE-ID-001" + name = "First with ID" +""" + content2 = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class TestTwo(BaseAPITestCase): + id = "DUPLICATE-ID-001" # Same ID + name = "Second with ID" +""" + self._create_test_case_file("file_one.py", content1) + self._create_test_case_file("file_two.py", content2) + with self.assertLogs(level='WARNING') as log_watcher: + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + self.assertTrue(any("发现重复的测试用例 ID: 'DUPLICATE-ID-001'" in msg for msg in log_watcher.output)) + + all_cases = registry.get_all_test_case_classes() + # inspect.getmembers order is not guaranteed across files, so we can't be sure which one is kept. + # However, the _registry (by ID) should have only one entry. + self.assertEqual(len(registry._registry), 1) + # The _test_case_classes list might have two if they are distinct class objects, but one overrides in _registry + # Depending on load order, one will overwrite the other in _registry. Let's check the final one. + registered_case = registry.get_test_case_by_id("DUPLICATE-ID-001") + self.assertIsNotNone(registered_case) + # We cannot reliably assert which name ('First with ID' or 'Second with ID') is kept due to file load order. + # Check that _test_case_classes might have more if classes are distinct but _registry has one. + # If the class objects are truly distinct, len(all_cases) could be 2. The important part is that by ID, only one is retrievable. + # A more robust check for `_test_case_classes` would be to ensure it contains the class that `_registry` points to. + self.assertIn(registered_case, all_cases) + # If the goal is that _test_case_classes should also be unique by some criteria after discovery, that logic would need adjustment. + # For now, get_all_test_case_classes returns all *discovered* classes that are BaseAPITestCase subclasses. + # And get_test_case_by_id returns the one that won the ID race. + # A typical use case iterates get_all_test_case_classes() for filtering, so this list should ideally be clean or documented. + # For now, we accept it might contain classes whose IDs were superseded if they are distinct objects. + + def test_get_applicable_test_cases_no_restrictions(self): + """测试 get_applicable_test_cases,当测试用例没有适用性限制时。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class NoRestrictionTest(BaseAPITestCase): + id = "TC-NR-001" + name = "No Restrictions" +""" + self._create_test_case_file("no_restriction.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + applicable = registry.get_applicable_test_cases("GET", "/api/items") + self.assertEqual(len(applicable), 1) + self.assertEqual(applicable[0].id, "TC-NR-001") + + def test_get_applicable_by_method(self): + """测试根据 applicable_methods 进行筛选。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class GetOnlyTest(BaseAPITestCase): + id = "TC-GET-ONLY" + name = "GET Only" + applicable_methods = ["GET", "HEAD"] +class PostOnlyTest(BaseAPITestCase): + id = "TC-POST-ONLY" + name = "POST Only" + applicable_methods = ["POST"] +""" + self._create_test_case_file("method_tests.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + + applicable_get = registry.get_applicable_test_cases("GET", "/api/data") + self.assertEqual(len(applicable_get), 1) + self.assertEqual(applicable_get[0].id, "TC-GET-ONLY") + + applicable_post = registry.get_applicable_test_cases("POST", "/api/data") + self.assertEqual(len(applicable_post), 1) + self.assertEqual(applicable_post[0].id, "TC-POST-ONLY") + + applicable_put = registry.get_applicable_test_cases("PUT", "/api/data") + self.assertEqual(len(applicable_put), 0) + + applicable_head = registry.get_applicable_test_cases("HEAD", "/api/data") # Case sensitive check for methods in list + self.assertEqual(len(applicable_head), 1) + self.assertEqual(applicable_head[0].id, "TC-GET-ONLY") + + def test_get_applicable_by_path_regex(self): + """测试根据 applicable_paths_regex 进行筛选。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class UserPathTest(BaseAPITestCase): + id = "TC-USER-PATH" + name = "User Path" + applicable_paths_regex = r"^/api/users/\\d+$" # Matches /api/users/ +class OrderPathTest(BaseAPITestCase): + id = "TC-ORDER-PATH" + name = "Order Path" + applicable_paths_regex = r"^/api/orders" +""" + self._create_test_case_file("path_tests.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + + applicable_user = registry.get_applicable_test_cases("GET", "/api/users/123") + self.assertEqual(len(applicable_user), 1) + self.assertEqual(applicable_user[0].id, "TC-USER-PATH") + + applicable_order = registry.get_applicable_test_cases("POST", "/api/orders/new") + self.assertEqual(len(applicable_order), 1) + self.assertEqual(applicable_order[0].id, "TC-ORDER-PATH") + + applicable_none1 = registry.get_applicable_test_cases("GET", "/api/products/789") + self.assertEqual(len(applicable_none1), 0) + + applicable_none2 = registry.get_applicable_test_cases("GET", "/api/users/profile") # Does not match \d+ + self.assertEqual(len(applicable_none2), 0) + + def test_get_applicable_by_method_and_path(self): + """测试同时根据方法和路径进行筛选。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class SpecificGetTest(BaseAPITestCase): + id = "TC-SPECIFIC-GET" + name = "Specific GET" + applicable_methods = ["GET"] + applicable_paths_regex = r"^/data/\\w+$" +""" + self._create_test_case_file("specific_get.py", content) + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + + applicable = registry.get_applicable_test_cases("GET", "/data/item1") + self.assertEqual(len(applicable), 1) + self.assertEqual(applicable[0].id, "TC-SPECIFIC-GET") + + not_applicable_method = registry.get_applicable_test_cases("POST", "/data/item1") + self.assertEqual(len(not_applicable_method), 0) + + not_applicable_path = registry.get_applicable_test_cases("GET", "/data/item1/details") + self.assertEqual(len(not_applicable_path), 0) + + def test_invalid_path_regex_handling(self): + """测试处理无效的路径正则表达式。""" + content = """ +from ddms_compliance_suite.test_framework_core import BaseAPITestCase, TestSeverity +class InvalidRegexTest(BaseAPITestCase): + id = "TC-INVALID-REGEX" + name = "Invalid Regex" + applicable_paths_regex = r"^/api/path_(" # Unbalanced parenthesis +""" + self._create_test_case_file("invalid_regex.py", content) + with self.assertLogs(level='ERROR') as log_watcher: + registry = TestCaseRegistry(test_cases_dir=TEMP_TEST_CASES_DIR) + self.assertTrue(any("中的路径正则表达式 'invalid_regex.InvalidRegexTest' 无效" in msg for msg in log_watcher.output)) + + # The test case with invalid regex should not match any path + applicable = registry.get_applicable_test_cases("GET", "/api/path_something") + self.assertEqual(len(applicable), 0) + +if __name__ == '__main__': + # Configure logging for detailed output when running directly + # logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, + # format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') + unittest.main() \ No newline at end of file