def test_not_old(self, container, now): container['State']['FinishedAt'] = '2014-01-21T00:00:00Z' assert not docker_gc.should_remove_container(container, now)
def test_not_old_never_run(self, container, now, earlier_time): container['Created'] = str(now) container['State']['FinishedAt'] = docker_gc.YEAR_ZERO assert not docker_gc.should_remove_container(container, now)
def test_old_stopped(self, container, now): assert docker_gc.should_remove_container(container, now)
def test_is_running(self, container, now): container['State']['Running'] = True assert not docker_gc.should_remove_container(container, now)
def test_is_ghost(self, container, now): container['State']['Ghost'] = True assert docker_gc.should_remove_container(container, now)