update docstring for parse_parameters

This commit is contained in:
httprunner
2018-08-09 07:41:18 +08:00
parent a6bfcc9674
commit 2e430b69ed

View File

@@ -255,21 +255,28 @@ def parse_data(content, mapping):
def parse_parameters(parameters, testset_path=None): def parse_parameters(parameters, testset_path=None):
""" parse parameters and generate cartesian product """ parse parameters and generate cartesian product.
@params
(list) parameters: parameter name and value in list Args:
parameters (list) parameters: parameter name and value in list
parameter value may be in three types: parameter value may be in three types:
(1) data list (1) data list, e.g. ["iOS/10.1", "iOS/10.2", "iOS/10.3"]
(2) call built-in parameterize function (2) call built-in parameterize function, "${parameterize(account.csv)}"
(3) call custom function in debugtalk.py (3) call custom function in debugtalk.py, "${gen_app_version()}"
e.g.
[ testset_path (str): testset file path, used for locating csv file and debugtalk.py
{"user_agent": ["iOS/10.1", "iOS/10.2", "iOS/10.3"]},
{"username-password": "${parameterize(account.csv)}"}, Returns:
{"app_version": "${gen_app_version()}"} list: cartesian product list
]
(str) testset_path: testset file path, used for locating csv file and debugtalk.py Examples:
@return cartesian product in list >>> parameters = [
{"user_agent": ["iOS/10.1", "iOS/10.2", "iOS/10.3"]},
{"username-password": "${parameterize(account.csv)}"},
{"app_version": "${gen_app_version()}"}
]
>>> parse_parameters(parameters)
""" """
testcase_parser = TestcaseParser(file_path=testset_path) testcase_parser = TestcaseParser(file_path=testset_path)