check parameters format.

This commit is contained in:
debugtalk
2018-03-08 23:22:09 +08:00
parent 0568debaf1
commit 06ccff9be1
2 changed files with 4 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
__title__ = 'HttpRunner'
__description__ = 'HTTP test runner, not just about api test and load test.'
__url__ = 'https://github.com/HttpRunner/HttpRunner'
__version__ = '1.1.0-beta'
__version__ = '1.1.0-beta.1'
__author__ = 'debugtalk'
__author_email__ = 'mail@debugtalk.com'
__license__ = 'MIT'

View File

@@ -677,6 +677,9 @@ def parse_parameters(parameters, testset_path=None):
parsed_parameter_content = testcase_parser.eval_content_with_bindings(parameter_content)
# e.g. [{'app_version': '2.8.5'}, {'app_version': '2.8.6'}]
# e.g. [{"username": "user1", "password": "111111"}, {"username": "user2", "password": "222222"}]
if not isinstance(parsed_parameter_content, list):
raise exception.ParamsError("parameters syntax error!")
parameter_content_list = [
# get subset by parameter name
{key: parameter_item[key] for key in parameter_name_list}