'``BlockDeviceDeployer.calculate_changes`` does not yield a
``CreateBlockDeviceDataset`` change if a dataset with the same ID
exists with different metadata.'

def test_match_configuration_to_state_of_datasets(self):

    expected_hostname = u'192.0.2.123'
    expected_dataset_id = unicode(uuid4())
    local_state = NodeState(hostname=expected_hostname, uuid=uuid4(), paths={expected_dataset_id: FilePath('/flocker').child(expected_dataset_id.encode('ascii'))}, devices={UUID(expected_dataset_id): FilePath('/dev/loop0')}, manifestations={expected_dataset_id: Manifestation(primary=True, dataset=Dataset(dataset_id=expected_dataset_id, maximum_size=int(REALISTIC_BLOCKDEVICE_SIZE.to_Byte()), metadata={}, deleted=False))})
    desired_configuration = Deployment(nodes=[Node(hostname=expected_hostname, uuid=local_state.uuid, manifestations=local_state.manifestations.transform((expected_dataset_id, 'dataset', 'metadata'), {u'name': u'my_volume'}))])
    actual_changes = self._calculate_changes(local_state.uuid, expected_hostname, local_state, desired_configuration)
    expected_changes = in_parallel(changes=[])
    self.assertEqual(expected_changes, actual_changes)
