Closes #1588, image.tag does not return anything

This patch returns the check made against api when tagging an image as stated in documentation

Signed-off-by: Olivier Sallou <olivier.sallou@irisa.fr>
This commit is contained in:
Olivier Sallou 2017-06-16 17:49:43 +02:00
parent 8fc6540fea
commit d638829f73
2 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,7 @@ class Image(Model):
Returns:
(bool): ``True`` if successful
"""
self.client.api.tag(self.id, repository, tag=tag, **kwargs)
return self.client.api.tag(self.id, repository, tag=tag, **kwargs)
class ImageCollection(Collection):

View File

@ -71,7 +71,8 @@ class ImageTest(BaseIntegrationTest):
client = docker.from_env(version=TEST_API_VERSION)
image = client.images.pull('alpine:latest')
image.tag(repo, tag)
result = image.tag(repo, tag)
assert result is True
self.tmp_imgs.append(identifier)
assert image.id in get_ids(client.images.list(repo))
assert image.id in get_ids(client.images.list(identifier))