def test_create_quota_limit(self): project_id = UUID2 resource = "cores" limit = self.create_quota_limit(self.ctx, project_id=project_id, resource=resource, limit=15) self.assertIsNotNone(limit) cores_limit = db_api.quota_get(self.ctx, project_id, resource) self.assertIsNotNone(cores_limit) self.assertEqual(15, cores_limit.hard_limit)
def test_create_quota_limit(self): project_id = UUID2 resource = 'cores' limit = self.create_quota_limit(self.ctx, project_id=project_id, resource=resource, limit=15) self.assertIsNotNone(limit) cores_limit = db_api.quota_get(self.ctx, project_id, resource) self.assertIsNotNone(cores_limit) self.assertEqual(15, cores_limit.hard_limit)
def test_update_quota_limit(self): project_id = UUID2 resource = "cores" limit = self.create_quota_limit(self.ctx, project_id=project_id, resource=resource, limit=15) self.assertIsNotNone(limit) updated = db_api.quota_update(self.ctx, project_id, resource, 10) self.assertIsNotNone(updated) updated_limit = db_api.quota_get(self.ctx, project_id, resource) self.assertEqual(10, updated_limit.hard_limit)
def test_update_quota_limit(self): project_id = UUID2 resource = 'cores' limit = self.create_quota_limit(self.ctx, project_id=project_id, resource=resource, limit=15) self.assertIsNotNone(limit) updated = db_api.quota_update(self.ctx, project_id, resource, 10) self.assertIsNotNone(updated) updated_limit = db_api.quota_get(self.ctx, project_id, resource) self.assertEqual(10, updated_limit.hard_limit)