'Utility function to create a container configuration via the API.
Also creates a second container not manipulated in the tests, to
ensure that unrelated applications do not get modified, moved or
wiped out.'

def _create_container(self):

    saving = self.persistence_service.save(Deployment(nodes={Node(uuid=self.NODE_A_UUID, applications={u'leavemealone': Application(name=u'leavemealone', image=DockerImage.from_string(u'busybox'))}), Node(uuid=self.NODE_B_UUID)}))
    saving.addCallback((lambda _: self.assertResponseCode('POST', '/configuration/containers', {u'node_uuid': self.NODE_A, u'name': u'mycontainer', u'image': u'busybox'}, CREATED)))
    return saving
