summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-01-30 16:13:46 -0800
committerJoffrey F <joffrey@docker.com>2018-01-30 16:47:04 -0800
commit17aa31456d99651c651683535243647508eec628 (patch)
treeca67643ecd1a7267b4da3952822b8660c6a91c2e /tests/unit
parenta05922e94940f90be5c136d8d5ffaeeba4c7d59c (diff)
downloaddocker-py-1761-dockerclient-pull.tar.gz
Properly support pulling all tags in DockerClient.images.pull1761-dockerclient-pull
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/models_images_test.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/unit/models_images_test.py b/tests/unit/models_images_test.py
index 9ecb7e4..dacd72b 100644
--- a/tests/unit/models_images_test.py
+++ b/tests/unit/models_images_test.py
@@ -41,9 +41,22 @@ class ImageCollectionTest(unittest.TestCase):
def test_pull(self):
client = make_fake_client()
- image = client.images.pull('test_image')
+ image = client.images.pull('test_image:latest')
+ client.api.pull.assert_called_with('test_image', tag='latest')
+ client.api.inspect_image.assert_called_with('test_image:latest')
+ assert isinstance(image, Image)
+ assert image.id == FAKE_IMAGE_ID
+
+ def test_pull_multiple(self):
+ client = make_fake_client()
+ images = client.images.pull('test_image')
client.api.pull.assert_called_with('test_image', tag=None)
- client.api.inspect_image.assert_called_with('test_image')
+ client.api.images.assert_called_with(
+ all=False, name='test_image', filters=None
+ )
+ client.api.inspect_image.assert_called_with(FAKE_IMAGE_ID)
+ assert len(images) == 1
+ image = images[0]
assert isinstance(image, Image)
assert image.id == FAKE_IMAGE_ID