Exemple #1
0
def test_container_state_invalid_container(docker_client):
    docker_client.should_receive("inspect_container").with_args("abcd").and_raise(_not_found_error)

    result = exec_._container_state(docker_client, "abcd")
    assert result == exec_._NOT_CREATED
Exemple #2
0
def test_container_state_container_exists(docker_client, inspection, expect):
    docker_client.should_receive("inspect_container").with_args("abcd").and_return(inspection)

    result = exec_._container_state(docker_client, "abcd")
    assert result == expect
Exemple #3
0
def test_container_state_no_container(docker_client):
    result = exec_._container_state(docker_client, None)
    assert result == exec_._NOT_CREATED