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