summaryrefslogtreecommitdiff
path: root/tests/unit/models_containers_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/models_containers_test.py')
-rw-r--r--tests/unit/models_containers_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/models_containers_test.py b/tests/unit/models_containers_test.py
index 2b0b499..48a5288 100644
--- a/tests/unit/models_containers_test.py
+++ b/tests/unit/models_containers_test.py
@@ -359,6 +359,18 @@ class ContainerCollectionTest(unittest.TestCase):
assert isinstance(containers[0], Container)
assert containers[0].id == FAKE_CONTAINER_ID
+ def test_list_ignore_removed(self):
+ def side_effect(*args, **kwargs):
+ raise docker.errors.NotFound('Container not found')
+ client = make_fake_client({
+ 'inspect_container.side_effect': side_effect
+ })
+
+ with pytest.raises(docker.errors.NotFound):
+ client.containers.list(all=True, ignore_removed=False)
+
+ assert client.containers.list(all=True, ignore_removed=True) == []
+
class ContainerTest(unittest.TestCase):
def test_name(self):