(raw_testinfo)
extend with api reference

    Raises:
        exceptions.ApiNotFound: api not found
extend with api reference
extend with api reference
def __extend_with_api_ref(raw_testinfo):
    """ extend with api reference

    Raises:
        exceptions.ApiNotFound: api not found

    """
    api_name = raw_testinfo["api"]

    # api maybe defined in two types:
    # 1, individual file: each file is corresponding to one api definition
    # 2, api sets file: one file contains a list of api definitions
    if not os.path.isabs(api_name):
        # make compatible with Windows/Linux
        api_path = os.path.join(tests_def_mapping["PWD"], *api_name.split("/"))
        if os.path.isfile(api_path):
            # type 1: api is defined in individual file
            api_name = api_path

    try:
        block = tests_def_mapping["api"][api_name]
        # NOTICE: avoid project_mapping been changed during iteration.
        raw_testinfo["api_def"] = utils.deepcopy_dict(block)
    except KeyError:
        raise exceptions.ApiNotFound("{} not found!".format(api_name))
def __extend_with_api_ref ( raw_testinfo ) : api_name = raw_testinfo [ "api" ] # api maybe defined in two types: # 1, individual file: each file is corresponding to one api definition # 2, api sets file: one file contains a list of api definitions if not os . path . isabs ( api_name ) : # make compatible with Windows/Linux api_path = os . path . join ( tests_def_mapping [ "PWD" ] , * api_name . split ( "/" ) ) if os . path . isfile ( api_path ) : # type 1: api is defined in individual file api_name = api_path try : block = tests_def_mapping [ "api" ] [ api_name ] # NOTICE: avoid project_mapping been changed during iteration. raw_testinfo [ "api_def" ] = utils . deepcopy_dict ( block ) except KeyError : raise exceptions . ApiNotFound ( "{} not found!" . format ( api_name ) )