fix(endpoints): added in proper error handling
before we would return a 400 without a message because the errors were not being caught Issue: https://www.pivotaltracker.com/story/show/145459707 - [ ] It works! - [ ] Comments provide sufficient explanations for the next contributor - [ ] Tests cover changes and corner cases - [ ] Follows Quay syntax patterns and format
This commit is contained in:
parent
165486180d
commit
5e6aa6648b
3 changed files with 27 additions and 4 deletions
|
@ -4834,6 +4834,20 @@ class TestRepositoryManifestLabels(ApiTestCase):
|
|||
|
||||
self.assertEquals(0, len(json['labels']))
|
||||
|
||||
self.postJsonResponse(RepositoryManifestLabels,
|
||||
params=dict(repository=repository,
|
||||
manifestref=tag_manifest.digest),
|
||||
data=dict(key='bad_label', value='world',
|
||||
media_type='text/plain'),
|
||||
expected_code=400)
|
||||
|
||||
self.postJsonResponse(RepositoryManifestLabels,
|
||||
params=dict(repository=repository,
|
||||
manifestref=tag_manifest.digest),
|
||||
data=dict(key='hello', value='world',
|
||||
media_type='bad_media_type'),
|
||||
expected_code=400)
|
||||
|
||||
# Add some labels to the manifest.
|
||||
with assert_action_logged('manifest_label_add'):
|
||||
label1 = self.postJsonResponse(RepositoryManifestLabels,
|
||||
|
|
Reference in a new issue