mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-14 12:19:39 +08:00
relocate testcase validator
This commit is contained in:
@@ -32,47 +32,6 @@ def extract_functions(content):
|
||||
return []
|
||||
|
||||
|
||||
def is_testset(data_structure):
|
||||
""" check if data_structure is a testset
|
||||
testset should always be in the following data structure:
|
||||
{
|
||||
"name": "desc1",
|
||||
"config": {},
|
||||
"api": {},
|
||||
"testcases": [testcase11, testcase12]
|
||||
}
|
||||
"""
|
||||
if not isinstance(data_structure, dict):
|
||||
return False
|
||||
|
||||
if "name" not in data_structure or "testcases" not in data_structure:
|
||||
return False
|
||||
|
||||
if not isinstance(data_structure["testcases"], list):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def is_testsets(data_structure):
|
||||
""" check if data_structure is testset or testsets
|
||||
testsets should always be in the following data structure:
|
||||
testset_dict
|
||||
or
|
||||
[
|
||||
testset_dict_1,
|
||||
testset_dict_2
|
||||
]
|
||||
"""
|
||||
if not isinstance(data_structure, list):
|
||||
return is_testset(data_structure)
|
||||
|
||||
for item in data_structure:
|
||||
if not is_testset(item):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def gen_cartesian_product(*args):
|
||||
""" generate cartesian product for lists
|
||||
@param
|
||||
|
||||
Reference in New Issue
Block a user