<commit_before>import pytest
import os

from xd.docker.client import *


def test_restart(docker, stdout):
    os.system("docker run -d --name xd-docker-test busybox:latest sleep 5")
    docker.container_restart('xd-docker-test')


def test_already_stopped(docker, stdout):
    os.system("docker run --name xd-docker-test busybox:latest true")
    docker.container_restart('xd-docker-test')


def test_not_started(docker, stdout):
    os.system("docker create --name xd-docker-test busybox:latest true")
    docker.container_restart('xd-docker-test')


def test_no_such_container(docker, stdout):
    with pytest.raises(ClientError) as clienterror:
        with stdout.redirect():
            docker.container_stop('xd-docker-test')
    assert clienterror.value.code == 404<commit_msg>tests: Fix container_restart() integration test<commit_after>import pytest
import os

from xd.docker.client import *


def test_restart(docker, stdout):
    os.system("docker run -d --name xd-docker-test busybox:latest sleep 5")
    docker.container_restart('xd-docker-test')


def test_already_stopped(docker, stdout):
    os.system("docker run --name xd-docker-test busybox:latest true")
    docker.container_restart('xd-docker-test')


def test_not_started(docker, stdout):
    os.system("docker create --name xd-docker-test busybox:latest true")
    docker.container_restart('xd-docker-test')


def test_no_such_container(docker, stdout):
    with pytest.raises(ClientError) as clienterror:
        with stdout.redirect():
            docker.container_restart('xd-docker-test')
    assert clienterror.value.code == 404
{'fraction_non_alphanumeric': 0.11761045426260112, 'fraction_numerical': 0.004978220286247666, 'mean_word_length': 4.342192691029901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '923296', 'n_tokens_mistral': 561, 'n_tokens_neox': 506, 'n_words': 107}