'An API request to update a named container\'s host to a different host
where the container has an attached dataset results in an updated
configuration, with the dataset\'s primary host also moved to the new
container host.'

def test_update_moves_dataset(self):

    manifestation = _manifestation()
    application = Application(name=u'postgres', image=DockerImage.from_string(u'postgres'), volume=AttachedVolume(manifestation=manifestation, mountpoint=FilePath('/var/lib/postgresql/9.4/data/base')))
    deployment = Deployment(nodes={Node(uuid=self.NODE_A_UUID, manifestations={manifestation.dataset_id: manifestation}, applications={application.name: application}), Node(uuid=self.NODE_B_UUID)})
    d = self.persistence_service.save(deployment)
    d.addCallback((lambda _: self.assertResponseCode('POST', '/configuration/containers/postgres', {u'node_uuid': self.NODE_B}, OK)))
    def updated(_):
        deployment = self.persistence_service.get()
        expected = Deployment(nodes={Node(uuid=self.NODE_A_UUID), Node(uuid=self.NODE_B_UUID, manifestations={manifestation.dataset_id: manifestation}, applications={application.name: application})})
        self.assertEqual(deployment, expected)
    d.addCallback(updated)
    return d
