parsers.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:apitest 作者: BBVA 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号