mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 11:29:48 +08:00
refactor: rename to JsonSchemaCommonChecker
This commit is contained in:
@@ -2,7 +2,7 @@ import importlib
|
||||
import os
|
||||
|
||||
from httprunner import exceptions, logger, utils
|
||||
from httprunner.loader.check import JsonSchemaChecker, JsonSchemaV2Checker
|
||||
from httprunner.loader.check import JsonSchemaCommonChecker, JsonSchemaV2Checker
|
||||
from httprunner.loader.load import load_module_functions, load_file, load_dot_env_file, \
|
||||
load_folder_files
|
||||
from httprunner.loader.locate import init_project_working_directory, get_project_working_directory
|
||||
@@ -281,7 +281,7 @@ def load_testsuite(raw_testsuite):
|
||||
}
|
||||
|
||||
"""
|
||||
JsonSchemaChecker.validate_testsuite_format(raw_testsuite)
|
||||
JsonSchemaCommonChecker.validate_testsuite_format(raw_testsuite)
|
||||
raw_testcases = raw_testsuite.pop("testcases")
|
||||
raw_testsuite["testcases"] = {}
|
||||
|
||||
@@ -359,7 +359,7 @@ def load_test_file(path):
|
||||
|
||||
elif "request" in raw_content:
|
||||
# file_type: api
|
||||
JsonSchemaChecker.validate_api_format(raw_content)
|
||||
JsonSchemaCommonChecker.validate_api_format(raw_content)
|
||||
loaded_content = raw_content
|
||||
loaded_content["path"] = path
|
||||
loaded_content["type"] = "api"
|
||||
|
||||
@@ -26,7 +26,7 @@ with open(testsuite_schema_path) as f:
|
||||
testsuite_schema = json.load(f)
|
||||
|
||||
|
||||
class JsonSchemaChecker(object):
|
||||
class JsonSchemaCommonChecker(object):
|
||||
|
||||
@staticmethod
|
||||
def validate_api_format(content):
|
||||
@@ -50,11 +50,11 @@ class JsonSchemaChecker(object):
|
||||
return True
|
||||
|
||||
|
||||
class JsonSchemaV1Checker(JsonSchemaChecker):
|
||||
class JsonSchemaV1Checker(JsonSchemaCommonChecker):
|
||||
pass
|
||||
|
||||
|
||||
class JsonSchemaV2Checker(JsonSchemaChecker):
|
||||
class JsonSchemaV2Checker(JsonSchemaCommonChecker):
|
||||
|
||||
@staticmethod
|
||||
def validate_testcase_format(content):
|
||||
|
||||
Reference in New Issue
Block a user