New tests and small fixes while comparing against the V2 spec

Fixes #391
This commit is contained in:
Joseph Schorr 2015-09-29 15:02:03 -04:00
parent 41bfe2ffde
commit decdaa4c79
6 changed files with 232 additions and 33 deletions

View file

@ -40,7 +40,11 @@ def get_tag(namespace, repository, tag):
permission = ReadRepositoryPermission(namespace, repository)
if permission.can() or model.repository.repository_is_public(namespace, repository):
tag_image = model.tag.get_tag_image(namespace, repository, tag)
try:
tag_image = model.tag.get_tag_image(namespace, repository, tag)
except model.DataModelException:
abort(404)
resp = make_response('"%s"' % tag_image.docker_image_id)
resp.headers['Content-Type'] = 'application/json'
return resp