Exemple #1
0
def existing_bc_set_record(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.build_groups, id_input):
        raise argparse.ArgumentTypeError(
            "no BuildConfigurationSetRecord with ID {} exists".format(
                id_input))
    return id_input
Exemple #2
0
def existing_product_version(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.product_versions, id_input):
        raise argparse.ArgumentTypeError("no ProductVersion with ID {} exists".format(id_input))
    return id_input
Exemple #3
0
def existing_environment_id(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.environments, id_input):
        raise argparse.ArgumentTypeError(
            "no BuildEnvironment exists with id {}".format(id_input))
    return id_input
Exemple #4
0
def existing_bc_id(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.build_configs, id_input):
        raise argparse.ArgumentTypeError("no BuildConfiguration with ID {} exists".format(id_input))
    return id_input
Exemple #5
0
def existing_rc_id(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.repositories, id_input):
        raise argparse.ArgumentTypeError("no RepositoryConfiguration with ID {} exists".format(id_input))
    return id_input
Exemple #6
0
def existing_rc_id(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.repositories, id_input):
        raise argparse.ArgumentTypeError(
            "no RepositoryConfiguration with ID {} exists".format(id_input))
    return id_input
Exemple #7
0
def existing_product_version(id_input):
    valid_id(id_input)
    if not common.id_exists(versions_api, id_input):
        raise argparse.ArgumentTypeError(
            "no ProductVersion with ID {} exists".format(id_input))
    return id_input
Exemple #8
0
def existing_product_release(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.product_releases, id_input):
        raise argparse.ArgumentTypeError("no ProductRelease with ID {} exists.".format(id_input))
    return id_input
Exemple #9
0
def existing_environment_id(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.environments, id_input):
        raise argparse.ArgumentTypeError("no BuildEnvironment exists with id {}".format(id_input))
    return id_input
Exemple #10
0
def existing_bc_id(id_input):
    valid_id(id_input)
    if not common.id_exists(configs_api, id_input):
        raise argparse.ArgumentTypeError(
            "no BuildConfiguration with ID {} exists".format(id_input))
    return id_input
Exemple #11
0
def existing_product_milestone(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.product_milestones, id_input):
        raise argparse.ArgumentTypeError("no ProductMilestone with ID {} exist".format(id_input))
    return id_input
Exemple #12
0
def existing_build_record(id_input):
    valid_id(id_input)
    if not common.id_exists(records_api, id_input):
        raise argparse.ArgumentTypeError(
            "no BuildRecord with ID {} exists".format(id_input))
    return id_input
Exemple #13
0
def existing_product_release(id_input):
    valid_id(id_input)
    if not common.id_exists(releases_api, id_input):
        raise argparse.ArgumentTypeError(
            "no ProductRelease with ID {} exists.".format(id_input))
    return id_input
Exemple #14
0
def existing_product_milestone(id_input):
    valid_id(id_input)
    if not common.id_exists(milestones_api, id_input):
        raise argparse.ArgumentTypeError(
            "no ProductMilestone with ID {} exist".format(id_input))
    return id_input
Exemple #15
0
def existing_license(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.licenses, id_input):
        raise argparse.ArgumentTypeError(
            "no License with ID {} exists".format(id_input))
    return id_input
Exemple #16
0
def existing_license(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.licenses, id_input):
        raise argparse.ArgumentTypeError("no License with ID {} exists".format(id_input))
    return id_input
Exemple #17
0
def existing_running_build(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.running_builds, id_input):
        raise argparse.ArgumentTypeError(
            "no RunningBuild with ID {} exists".format(id_input))
    return id_input
Exemple #18
0
def existing_running_build(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.running_builds, id_input):
        raise argparse.ArgumentTypeError("no RunningBuild with ID {} exists".format(id_input))
    return id_input
Exemple #19
0
def existing_product_id(id_input):
    valid_id(id_input)
    if not common.id_exists(pnc_api.products, id_input):
        raise argparse.ArgumentTypeError(
            "no Product with ID {} exists".format(id_input))
    return id_input
Exemple #20
0
def test_id_exists_notexist(mock):
    api = 'test-api'
    search_id = 'search-id'
    assert not common.id_exists(api, search_id)
    mock.assert_called_once_with('test-api', 'get_specific', id='search-id')