(test_file: Text)
return test_file_content
load testcase/testsuite file content
load testcase/testsuite file content
load testcase / testsuite file content
def load_test_file(test_file: Text) -> Dict:
    """load testcase/testsuite file content"""
    if not os.path.isfile(test_file):
        raise exceptions.FileNotFound(f"test file not exists: {test_file}")

    file_suffix = os.path.splitext(test_file)[1].lower()
    if file_suffix == ".json":
        test_file_content = _load_json_file(test_file)
    elif file_suffix in [".yaml", ".yml"]:
        test_file_content = _load_yaml_file(test_file)
    else:
        # '' or other suffix
        raise exceptions.FileFormatError(
            f"testcase/testsuite file should be YAML/JSON format, invalid format file: {test_file}"
        )

    return test_file_content
def load_test_file ( test_file : Text ) -> Dict : if not os . path . isfile ( test_file ) : raise exceptions . FileNotFound ( f"test file not exists: {test_file}" ) file_suffix = os . path . splitext ( test_file ) [ 1 ] . lower ( ) if file_suffix == ".json" : test_file_content = _load_json_file ( test_file ) elif file_suffix in [ ".yaml" , ".yml" ] : test_file_content = _load_yaml_file ( test_file ) else : # '' or other suffix raise exceptions . FileFormatError ( f"testcase/testsuite file should be YAML/JSON format, invalid format file: {test_file}" ) return test_file_content