mirror of https://github.com/docker/docker-py.git
commit
bb665257ed
|
@ -30,10 +30,10 @@ class Image(Model):
|
||||||
"""
|
"""
|
||||||
The image's tags.
|
The image's tags.
|
||||||
"""
|
"""
|
||||||
return [
|
tags = self.attrs.get('RepoTags')
|
||||||
tag for tag in self.attrs.get('RepoTags', [])
|
if tags is None:
|
||||||
if tag != '<none>:<none>'
|
tags = []
|
||||||
]
|
return [tag for tag in tags if tag != '<none>:<none>']
|
||||||
|
|
||||||
def history(self):
|
def history(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -83,6 +83,11 @@ class ImageTest(unittest.TestCase):
|
||||||
})
|
})
|
||||||
assert image.tags == []
|
assert image.tags == []
|
||||||
|
|
||||||
|
image = Image(attrs={
|
||||||
|
'RepoTags': None
|
||||||
|
})
|
||||||
|
assert image.tags == []
|
||||||
|
|
||||||
def test_history(self):
|
def test_history(self):
|
||||||
client = make_fake_client()
|
client = make_fake_client()
|
||||||
image = client.images.get(FAKE_IMAGE_ID)
|
image = client.images.get(FAKE_IMAGE_ID)
|
||||||
|
|
Loading…
Reference in New Issue