'If the configuration indicates a dataset with a primary manifestation
on the node has been deleted and the volume associated with that
dataset is attached but has no filesystem,
``BlockDeviceDeployer.calculate_changes`` returns a ``DetachVolume``
state change operation.'

def test_deleted_dataset_volume_no_filesystem(self):

    local_state = self.ONE_DATASET_STATE
    local_config = to_node(local_state).transform(['manifestations', unicode(self.DATASET_ID), 'dataset', 'deleted'], True)
    local_state = local_state.transform(['manifestations', unicode(self.DATASET_ID)], discard)
    local_state = local_state.transform(['paths', unicode(self.DATASET_ID)], discard)
    device = FilePath('/dev/sda')
    self.assertEqual([self.DATASET_ID], local_state.devices.keys())
    assert_calculated_changes(case=self, node_state=local_state, node_config=local_config, nonmanifest_datasets=[self.MANIFESTATION.dataset], expected_changes=in_parallel(changes=[DetachVolume(dataset_id=self.DATASET_ID, blockdevice_id=self.BLOCKDEVICE_ID)]), discovered_datasets=[DiscoveredDataset(state=DatasetStates.ATTACHED_NO_FILESYSTEM, dataset_id=self.DATASET_ID, blockdevice_id=_create_blockdevice_id_for_test(self.DATASET_ID), maximum_size=int(REALISTIC_BLOCKDEVICE_SIZE.to_Byte()), device_path=device)])
