예제 #1
0
파일: test_db_api.py 프로젝트: afliu/cinder
 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'))
예제 #2
0
 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"))
예제 #3
0
 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'))