'Test attachment_delete.'

def test_attachment_delete(self):

    volume_params = {'status': 'available'}
    vref = tests_utils.create_volume(self.context, **volume_params)
    self.manager.create_volume(self.context, vref)
    values = {'volume_id': vref.id, 'volume_host': vref.host, 'attach_status': 'reserved', 'instance_uuid': fake.UUID1}
    attachment_ref = db.volume_attach(self.context, values)
    attachment_ref = db.volume_attachment_get(self.context, attachment_ref['id'])
    self.manager.attachment_delete(self.context, attachment_ref['id'], vref)
    self.assertRaises(exception.VolumeAttachmentNotFound, db.volume_attachment_get, self.context, attachment_ref.id)
