<commit_before>from sen.docker_backend import DockerBackend
from .real import image_data, mock, container_data


def test_images_call():
    mock()
    b = DockerBackend()
    operation = b.get_images()
    images_response = operation.response
    assert len(images_response) == 2
    assert images_response[0].image_id == image_data[0]["Id"]
    assert images_response[0].short_name == image_data[0]["RepoTags"][0]
    assert images_response[0].parent_id == image_data[0]["ParentId"]
    assert images_response[0].created_int == image_data[0]["Created"]
    assert [str(x) for x in images_response[0].names] == image_data[0]["RepoTags"]


def test_containers_call():
    mock()
    b = DockerBackend()
    operation = b.get_containers()
    containers_response = operation.response
    assert len(containers_response) == 1
    assert containers_response[0].container_id == container_data["Id"]
    assert containers_response[0].names == container_data["Names"]
    assert containers_response[0].short_name == container_data["Names"][0]
    assert containers_response[0].created_int == container_data["Created"]
    assert containers_response[0].command == container_data["Command"]
    assert containers_response[0].status == container_data["Status"]
    assert containers_response[0].running is False<commit_msg>tests: ask for non-cached response<commit_after>from sen.docker_backend import DockerBackend
from .real import image_data, mock, container_data


def test_images_call():
    mock()
    b = DockerBackend()
    operation = b.get_images(cached=False)
    images_response = operation.response
    assert len(images_response) == 2
    assert images_response[0].image_id == image_data[0]["Id"]
    assert images_response[0].short_name == image_data[0]["RepoTags"][0]
    assert images_response[0].parent_id == image_data[0]["ParentId"]
    assert images_response[0].created_int == image_data[0]["Created"]
    assert [str(x) for x in images_response[0].names] == image_data[0]["RepoTags"]


def test_containers_call():
    mock()
    b = DockerBackend()
    operation = b.get_containers(cached=False)
    containers_response = operation.response
    assert len(containers_response) == 1
    assert containers_response[0].container_id == container_data["Id"]
    assert containers_response[0].names == container_data["Names"]
    assert containers_response[0].short_name == container_data["Names"][0]
    assert containers_response[0].created_int == container_data["Created"]
    assert containers_response[0].command == container_data["Command"]
    assert containers_response[0].status == container_data["Status"]
    assert containers_response[0].running is False
{'fraction_non_alphanumeric': 0.12345679012345678, 'fraction_numerical': 0.015712682379349047, 'mean_word_length': 5.490291262135922, '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': '4984448', 'n_tokens_mistral': 792, 'n_tokens_neox': 787, 'n_words': 153}