def test_create_quota(): try: sdk_quota.create_quota("jenkins", cpus=4.0, mem=4000) quotas = sdk_quota.list_quotas() present = False for quota in quotas['infos']: if quota['role'] == "jenkins": present = True break assert present, "There was no quota present for the jenkins role" finally: sdk_quota.remove_quota("jenkins") quotas = sdk_quota.list_quotas() if 'infos' in quotas: for quota in quotas['infos']: assert quota['role'] != "jenkins"
def _set_quota(role, cpus): sdk_quota.create_quota(role, cpus=cpus)
def _set_quota(role, cpus, memory, quota_type): sdk_quota.create_quota(role, cpus=cpus, mem=memory, quota_type=quota_type)
def _set_quota(role, cpus, memory): sdk_quota.create_quota(role, cpus=cpus, mem=memory)