'``DestroyVolume.run`` uses the deployer\'s ``IBlockDeviceAPI`` to
destroy its volume.'

def test_run(self):

    node = u'192.0.2.1'
    dataset_id = uuid4()
    deployer = create_blockdevicedeployer(self, hostname=node)
    api = deployer.block_device_api
    volume = api.create_volume(dataset_id=dataset_id, size=LOOPBACK_MINIMUM_ALLOCATABLE_SIZE)
    blockdevice_id = volume.blockdevice_id
    change = DestroyVolume(blockdevice_id=blockdevice_id)
    state_persister = InMemoryStatePersister()
    state_persister.record_ownership(dataset_id, blockdevice_id)
    self.successResultOf(run_state_change(change, deployer, state_persister))
    self.assertEqual(state_persister.get_state().blockdevice_ownership, {dataset_id: blockdevice_id})
    self.assertEqual([], api.list_volumes())
