Merge pull request #2715 from charltonaustin/fix_endpoint_error
fix(endpoints): added in proper error handling
This commit is contained in:
commit
0841d2bfb9
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