def postman_parser_form_file(file_path: str,
environment_vars: dict = None):
"""
Get a parser collection, in JSON input format, and parser it
:param file_path: file path
:type file_path: str
:return: a Postman object
:rtype: APITest
:raise ApitestInvalidFormatError: When the Postman JSON file has wrong format
"""
assert file_path is not None
with open(file_path, "r") as f:
try:
loaded_data = load(f)
except (ValueError, TypeError) as e:
raise ApitestInvalidFormatError from e
return postman_parser(loaded_data,
environment_vars)
评论列表
文章目录