Exemplo n.º 1
0
def test_teardown_persistent(counter, config, docker_client):
    with counter:
        counter.incr()

    config["global"]["persistent"] = True
    config["global"]["container_id"] = "abcd"
    config.write()

    exec_._teardown_container(counter, config, docker_client, "abcd")

    with counter:
        assert counter._get_value() == 0
    config.reload()
    assert config["global"]["container_id"] == "abcd"
Exemplo n.º 2
0
def test_teardown_last(counter, config, docker_client):
    with counter:
        counter.incr()

    config["global"]["container_id"] = "abcd"
    config.write()

    flexmock(docker_client).should_receive("stop").with_args("abcd")

    exec_._teardown_container(counter, config, docker_client, "abcd")

    with counter:
        assert counter._get_value() == 0
    config.reload()
    assert config["global"]["container_id"] == "abcd"