'If block device is attached elsewhere but is part of the configuration
for the deployer\'s node, ``calculate_changes`` does not
attempt to create a new dataset.'

def test_dataset_elsewhere(self):

    uuid = uuid4()
    dataset_id = uuid4()
    maximum_size = int(GiB(1).bytes)
    dataset = Dataset(dataset_id=unicode(dataset_id), maximum_size=maximum_size)
    manifestation = Manifestation(dataset=dataset, primary=True)
    node = u'192.0.2.1'
    configuration = Deployment(nodes={Node(uuid=uuid, manifestations={unicode(dataset_id): manifestation})})
    node_state = NodeState(uuid=uuid, hostname=node, applications=None, manifestations={}, devices={}, paths={})
    state = DeploymentState(nodes={node_state})
    deployer = create_blockdevicedeployer(self, hostname=node, node_uuid=uuid)
    local_state = BlockDeviceDeployerLocalState(node_uuid=uuid, hostname=node, datasets=dataset_map_from_iterable([DiscoveredDataset(state=DatasetStates.ATTACHED_ELSEWHERE, dataset_id=dataset_id, maximum_size=maximum_size, blockdevice_id=_create_blockdevice_id_for_test(dataset_id))]))
    changes = deployer.calculate_changes(configuration, state, local_state)
    self.assertEqual(in_parallel(changes=[NoOp(sleep=timedelta(seconds=3))]), changes)
