生成pdf报告

This commit is contained in:
gongwenxin
2025-06-27 17:58:51 +08:00
parent 38cfb67325
commit fca20523ca
34 changed files with 29439 additions and 6178 deletions
@@ -4,7 +4,7 @@ import json
class ResponseSchemaValidationCase(BaseAPITestCase):
id = "TC-CORE-FUNC-001"
name = "Response Body JSON Schema Validation"
name = "返回体JSON Schema验证"
description = "验证API响应体是否符合API规范中定义的JSON Schema。"
severity = TestSeverity.CRITICAL
tags = ["core-functionality", "schema-validation", "output-format"]
@@ -7,8 +7,8 @@ import string
class InvalidEnumValueCase(BaseAPITestCase):
id = "TC-ERROR-4006"
name = "Error Code 4006 - Invalid Enum Value Validation"
description = "测试当发送的参数值不在指定的枚举范围内时,API是否按预期返回code=-1的错误(状态码应为200"
name = "非法枚举值检查"
description = "测试当发送的参数值不在指定的枚举范围内时,API是否按预期返回code=4006的错误"
severity = TestSeverity.MEDIUM
tags = ["error-handling", "appendix-b", "4006", "invalid-enum"]
execution_order = 204 # 在数值越界之后执行
@@ -5,8 +5,8 @@ from ddms_compliance_suite.utils import schema_utils # Keep this import for util
class MissingRequiredFieldBodyCase(BaseAPITestCase):
id = "TC-ERROR-4003-BODY"
name = "Error Code -1 - Missing Required Request Body Field Validation"
description = "测试当请求体中缺少API规范定义的必填字段时,API是否按预期返回code=-1的错误。"
name = "缺失必填请求体字段检查"
description = "测试当请求体中缺少API规范定义的必填字段时,API是否按预期返回code=4003的错误。"
severity = TestSeverity.HIGH
tags = ["error-handling", "appendix-b", "4003", "required-fields", "request-body"]
execution_order = 210
@@ -4,8 +4,8 @@ import copy
class MissingRequiredFieldQueryCase(BaseAPITestCase):
id = "TC-ERROR-4003-QUERY"
name = "Error Code -1 - Missing Required Query Parameter Validation"
description = "测试当请求中缺少API规范定义的必填查询参数时,API是否按预期返回code=-1的错误。"
name = "缺失必填查询参数检查"
description = "测试当请求中缺少API规范定义的必填查询参数时,API是否按预期返回code=4003的错误。"
severity = TestSeverity.HIGH
tags = ["error-handling", "appendix-b", "4003", "required-fields", "query-parameters"]
execution_order = 211 # After body, before original combined one might have been
@@ -5,8 +5,8 @@ from ddms_compliance_suite.utils import schema_utils
class NumberOutOfRangeCase(BaseAPITestCase):
id = "TC-ERROR-4002"
name = "Error Code -1 - Number Value Out of Range Validation"
description = "测试当发送的数值参数超出范围限制时,API是否按预期返回code=-1的错误(状态码应为200"
name = "数值参数越界检查"
description = "测试当发送的数值参数超出范围限制时,API是否按预期返回code=4002的错误"
severity = TestSeverity.MEDIUM
tags = ["error-handling", "appendix-b", "4002", "out-of-range"]
execution_order = 203 # 在类型不匹配测试之后执行
@@ -6,8 +6,8 @@ from ddms_compliance_suite.utils import schema_utils
class TypeMismatchBodyCase(BaseAPITestCase):
id = "TC-ERROR-4001-BODY"
name = "Error Code -1 - Request Body Type Mismatch Validation"
description = "测试当发送的请求体中字段的数据类型与API规范定义不符时,API是否按预期返回code=-1的错误。"
name = "请求体字段类型不匹配检查"
description = "测试当发送的请求体中字段的数据类型与API规范定义不符时,API是否按预期返回code=4001的错误。"
severity = TestSeverity.MEDIUM
tags = ["error-handling", "appendix-b", "4001", "request-body"]
execution_order = 202 # Slightly after query param one
@@ -6,8 +6,8 @@ from ddms_compliance_suite.utils import schema_utils
class TypeMismatchQueryParamCase(BaseAPITestCase):
id = "TC-ERROR-4001-QUERY"
name = "Error Code -1 - Query Parameter Type Mismatch Validation"
description = "测试当发送的查询参数数据类型与API规范定义不符时,API是否按预期返回code=-1的错误。"
name = "查询参数类型不匹配检查"
description = "测试当发送的查询参数数据类型与API规范定义不符时,API是否按预期返回code=4001的错误。"
severity = TestSeverity.MEDIUM
tags = ["error-handling", "appendix-b", "4001", "query-parameters"]
execution_order = 201 # Slightly after the combined one might have been
@@ -4,7 +4,7 @@ import urllib.parse
class HTTPSMandatoryCase(BaseAPITestCase):
id = "TC-SECURITY-001"
name = "HTTPS Protocol Mandatory Verification"
name = "HTTPS 协议强制性检查"
description = "验证API端点是否通过HTTPS提供服务,以及HTTP请求是否被拒绝或重定向到HTTPS。"
severity = TestSeverity.CRITICAL
tags = ["security", "https", "transport-security"]