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