diff options
author | Milas Bowman <milas.bowman@docker.com> | 2022-07-29 15:28:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 15:28:16 -0400 |
commit | 868e996269b6934420f0cd2104621b6f45f668e5 (patch) | |
tree | 5b4f1b6ae2478e0528029489ed381c2353373d37 /tests/unit/models_images_test.py | |
parent | 26753c81defff28a1a38a34788e9653c8eb87c3d (diff) | |
download | docker-py-868e996269b6934420f0cd2104621b6f45f668e5.tar.gz |
model: add remove() to Image (#3026)
Allow an Image to be deleted by calling the remove() method on it,
just like a Volume.
Signed-off-by: Ahmon Dancy <dancy@dancysoft.com>
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Ahmon Dancy <dancy@dancysoft.com>
Diffstat (limited to 'tests/unit/models_images_test.py')
-rw-r--r-- | tests/unit/models_images_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/models_images_test.py b/tests/unit/models_images_test.py index 436fd61..3478c3f 100644 --- a/tests/unit/models_images_test.py +++ b/tests/unit/models_images_test.py @@ -150,6 +150,16 @@ class ImageTest(unittest.TestCase): image.history() client.api.history.assert_called_with(FAKE_IMAGE_ID) + def test_remove(self): + client = make_fake_client() + image = client.images.get(FAKE_IMAGE_ID) + image.remove() + client.api.remove_image.assert_called_with( + FAKE_IMAGE_ID, + force=False, + noprune=False, + ) + def test_save(self): client = make_fake_client() image = client.images.get(FAKE_IMAGE_ID) |