'``VolumeService.handoff()`` preserves the data from the relinquished
volume in the newly owned resulting volume in the local volume manager.'

def test_handoff_preserves_data(self):

    origin_service = create_volume_service(self)
    destination_service = create_volume_service(self)
    created = origin_service.create(origin_service.get(MY_VOLUME))
    def got_volume(volume):
        volume.get_filesystem().get_path().child('afile').setContent('exists')
        return origin_service.handoff(volume, LocalVolumeManager(destination_service))
    created.addCallback(got_volume)
    def handed_off(volumes):
        expected_volume = Volume(node_id=destination_service.node_id, name=MY_VOLUME, service=origin_service)
        root = expected_volume.get_filesystem().get_path()
        self.assertEqual(root.child('afile').getContent(), 'exists')
    created.addCallback(handed_off)
    return created
