def test_reservation_destroy(self): reservations = _quota_reserve(self.ctxt, 'project1') r1 = db.reservation_get(self.ctxt, reservations[0]) db.reservation_destroy(self.ctxt, reservations[1]) expected = {'project_id': 'project1', r1['resource']: {r1['uuid']: r1['delta']}} self.assertEqual(expected, db.reservation_get_all_by_project( self.ctxt, 'project1'))
def test_reservation_get_all_by_project(self): reservations = _quota_reserve(self.ctxt, "project1") r1 = db.reservation_get(self.ctxt, reservations[0]) r2 = db.reservation_get(self.ctxt, reservations[1]) expected = { "project_id": "project1", r1["resource"]: {r1["uuid"]: r1["delta"]}, r2["resource"]: {r2["uuid"]: r2["delta"]}, } self.assertEqual(expected, db.reservation_get_all_by_project(self.ctxt, "project1"))
def test_reservation_destroy(self): reservations = _quota_reserve(self.ctxt, 'project1') r1 = db.reservation_get(self.ctxt, reservations[0]) db.reservation_destroy(self.ctxt, reservations[1]) expected = { 'project_id': 'project1', r1['resource']: { r1['uuid']: r1['delta'] } } self.assertEqual( expected, db.reservation_get_all_by_project(self.ctxt, 'project1'))