Ejemplo n.º 1
0
def test_short_id():
    mock()
    b = DockerBackend()
    operation = b.get_images()
    images_response = operation.response
    assert images_response[0].short_id == image_data[0]["Id"][:12]
    assert images_response[1].short_id == "3ab9a7ed8a16"
Ejemplo n.º 2
0
def test_short_id():
    mock()
    b = DockerBackend()
    operation = b.get_images()
    images_response = operation.response
    assert images_response[0].short_id == image_data[0]["Id"][
        image_data[0]["Id"].index(":") + 1:][:12]
Ejemplo n.º 3
0
def test_images_call():
    mock()
    b = DockerBackend()
    operation = b.get_images()
    images_response = operation.response
    assert len(images_response) == 1
    assert images_response[0].image_id == image_data["Id"]
    assert images_response[0].short_name == image_data["RepoTags"][0]
Ejemplo n.º 4
0
def test_images_call():
    mock()
    b = DockerBackend()
    operation = b.get_images(cached=False)
    images_response = operation.response
    assert len(images_response) == 1
    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"]
Ejemplo n.º 5
0
def test_short_id():
    mock()
    b = DockerBackend()
    operation = b.get_images()
    images_response = operation.response
    assert images_response[0].short_id == image_data[0]["Id"][image_data[0]["Id"].index(":")+1:][:12]