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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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')