def test_update_node_instance_already_associated(self):
    node1 = utils.create_test_node(uuid=uuidutils.generate_uuid())
    new_i_uuid = uuidutils.generate_uuid()
    self.dbapi.update_node(node1.id, {'instance_uuid': new_i_uuid})
    node2 = utils.create_test_node(uuid=uuidutils.generate_uuid())
    self.assertRaises(exception.InstanceAssociated, self.dbapi.update_node, node2.id, {'instance_uuid': new_i_uuid})
def test_update_node_instance_already_associated(self):
    node1 = utils.create_test_node(uuid=uuidutils.generate_uuid())
    new_i_uuid = uuidutils.generate_uuid()
    self.dbapi.update_node(node1.id, {'instance_uuid': new_i_uuid})
    node2 = utils.create_test_node(uuid=uuidutils.generate_uuid())
    self.assertRaises(exception.InstanceAssociated, self.dbapi.update_node, node2.id, {'instance_uuid': new_i_uuid})