(testcase, json_file)
dump HAR entries to json testcase
dump HAR entries to json testcase
dump HAR entries to json testcase
def dump_json(testcase, json_file):
    """ dump HAR entries to json testcase
    """
    logger.info("dump testcase to JSON format.")

    with open(json_file, "w", encoding="utf-8") as outfile:
        my_json_str = json.dumps(testcase, ensure_ascii=False, indent=4)
        if isinstance(my_json_str, bytes):
            my_json_str = my_json_str.decode("utf-8")

        outfile.write(my_json_str)

    logger.info("Generate JSON testcase successfully: {}".format(json_file))
def dump_json ( testcase , json_file ) : logger . info ( "dump testcase to JSON format." ) with open ( json_file , "w" , encoding = "utf-8" ) as outfile : my_json_str = json . dumps ( testcase , ensure_ascii = False , indent = 4 ) if isinstance ( my_json_str , bytes ) : my_json_str = my_json_str . decode ( "utf-8" ) outfile . write ( my_json_str ) logger . info ( "Generate JSON testcase successfully: {}" . format ( json_file ) )