'A container is restarted if it is stopped.'

@require_cluster(1, require_container_agent=True)
def test_create_container_restart_stopped(self, cluster):

    responses = []
    def query_and_save():
        querying = query_http_server(cluster.nodes[0].public_address, 8080)
        querying.addCallback(responses.append)
        return querying
    created = self._create_container(cluster, SCRIPTS.child('exitinghttp.py'))
    created.addCallback((lambda ignored: query_and_save()))
    created.addCallback((lambda ignored: query_and_save()))
    def check_different_response(ignored):
        self.assertNotEqual(responses[0], responses[1], 'Responses    to    two    requests    were    the    same,    container    probably    did    not    restart.')
    created.addCallback(check_different_response)
    return created
