refactor: rename to JsonSchemaCommonChecker

This commit is contained in:
debugtalk
2019-12-31 18:59:46 +08:00
parent c334c9f335
commit 89c5d2e227
2 changed files with 6 additions and 6 deletions

View File

@@ -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"

View File

@@ -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):