Пример #1
0
def test_image_exists_negative(docker_client):
    docker_client.should_receive("inspect_image").with_args("img1").and_raise(_not_found_error)

    result = exec_._image_exists(docker_client, "img1")
    assert result == False

    result = exec_._image_exists(docker_client, None)
    assert result == False
Пример #2
0
def test_image_exists_positive(docker_client):
    docker_client.should_receive("inspect_image").with_args("img1").and_return({"State": None})

    result = exec_._image_exists(docker_client, "img1")
    assert result == True