update docstring for parse_parameters

This commit is contained in:
httprunner
2018-08-09 07:41:18 +08:00
parent a6bfcc9674
commit 2e430b69ed
+17 -10
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
Returns:
list: cartesian product list
Examples:
>>> parameters = [
{"user_agent": ["iOS/10.1", "iOS/10.2", "iOS/10.3"]}, {"user_agent": ["iOS/10.1", "iOS/10.2", "iOS/10.3"]},
{"username-password": "${parameterize(account.csv)}"}, {"username-password": "${parameterize(account.csv)}"},
{"app_version": "${gen_app_version()}"} {"app_version": "${gen_app_version()}"}
] ]
(str) testset_path: testset file path, used for locating csv file and debugtalk.py >>> parse_parameters(parameters)
@return cartesian product in list
""" """
testcase_parser = TestcaseParser(file_path=testset_path) testcase_parser = TestcaseParser(file_path=testset_path)