Example #1
0
    def test_delete_host_reservation(self):
        """Check all deletion cases for host reservation,
        including cascade deletion from reservations table.
        """

        self.assertRaises(RuntimeError, db_api.host_reservation_destroy, "fake_id")

        result = db_api.host_reservation_create(_get_fake_host_reservation_values())
        db_api.host_reservation_destroy(result["id"])
        self.assertIsNone(db_api.host_reservation_get(result["id"]))
        reserv = db_api.reservation_create(_get_fake_phys_reservation_values())
        result = db_api.host_reservation_create(_get_fake_host_reservation_values(reservation_id=reserv["id"]))
        db_api.reservation_destroy(reserv["id"])
        self.assertIsNone(db_api.host_reservation_get(result["id"]))
Example #2
0
    def test_delete_host_reservation(self):
        """Check deletion for host reservation

        Check all deletion cases for host reservation,
        including cascade deletion from reservations table.
        """

        self.assertRaises(db_exceptions.ClimateDBNotFound,
                          db_api.host_reservation_destroy, 'fake_id')

        result = db_api.host_reservation_create(
            _get_fake_host_reservation_values())
        db_api.host_reservation_destroy(result['id'])
        self.assertIsNone(db_api.host_reservation_get(result['id']))
        reserv = db_api.reservation_create(_get_fake_phys_reservation_values())
        result = db_api.host_reservation_create(
            _get_fake_host_reservation_values(reservation_id=reserv['id']))
        db_api.reservation_destroy(reserv['id'])
        self.assertIsNone(db_api.host_reservation_get(result['id']))
    def test_delete_host_reservation(self):
        """Check deletion for host reservation

        Check all deletion cases for host reservation,
        including cascade deletion from reservations table.
        """

        self.assertRaises(db_exceptions.ClimateDBNotFound,
                          db_api.host_reservation_destroy, 'fake_id')

        result = db_api.host_reservation_create(
            _get_fake_host_reservation_values())
        db_api.host_reservation_destroy(result['id'])
        self.assertIsNone(db_api.host_reservation_get(result['id']))
        reserv = db_api.reservation_create(_get_fake_phys_reservation_values())
        result = db_api.host_reservation_create(
            _get_fake_host_reservation_values(reservation_id=reserv['id']))
        db_api.reservation_destroy(reserv['id'])
        self.assertIsNone(db_api.host_reservation_get(result['id']))
Example #4
0
 def test_update_host_reservation(self):
     db_api.host_reservation_create(_get_fake_host_reservation_values(id=1))
     db_api.host_reservation_update(1, {"resource_properties": "updated"})
     res = db_api.host_reservation_get(1)
     self.assertEqual("updated", res["resource_properties"])
Example #5
0
 def test_update_host_reservation(self):
     db_api.host_reservation_create(_get_fake_host_reservation_values(id=1))
     db_api.host_reservation_update(1, {'resource_properties': 'updated'})
     res = db_api.host_reservation_get(1)
     self.assertEqual('updated', res['resource_properties'])
 def test_update_host_reservation(self):
     db_api.host_reservation_create(_get_fake_host_reservation_values(id=1))
     db_api.host_reservation_update(1, {'resource_properties': 'updated'})
     res = db_api.host_reservation_get(1)
     self.assertEqual('updated', res['resource_properties'])