From 0b549125d9334d21ecbba7f4c9ea6a3058905bc1 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 17 Nov 2016 14:55:14 -0500 Subject: [PATCH] Fix 500 on get label endpoint and add a test Fixes #2133 --- endpoints/api/manifest.py | 1 - test/test_api_usage.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/endpoints/api/manifest.py b/endpoints/api/manifest.py index 2a0daddd3..f41cb58b5 100644 --- a/endpoints/api/manifest.py +++ b/endpoints/api/manifest.py @@ -119,7 +119,6 @@ class ManageRepositoryManifestLabel(RepositoryParamResource): """ Resource for managing the labels on a specific repository manifest. """ @require_repo_read @nickname('getManifestLabel') - @parse_args() def get(self, namespace, repository, manifestref, labelid): """ Retrieves the label with the specific ID under the manifest. """ try: diff --git a/test/test_api_usage.py b/test/test_api_usage.py index 8fba30073..bde1f3175 100644 --- a/test/test_api_usage.py +++ b/test/test_api_usage.py @@ -4302,6 +4302,14 @@ class TestRepositoryManifestLabels(ApiTestCase): self.assertEquals('text/plain', label2['label']['media_type']) self.assertEquals('application/json', label3['label']['media_type']) + # Ensure we can retrieve each of the labels. + for label in json['labels']: + label_json = self.getJsonResponse(ManageRepositoryManifestLabel, + params=dict(repository=repository, + manifestref=tag_manifest.digest, + labelid=label['id'])) + self.assertEquals(label['id'], label_json['id']) + # Delete a label. with assert_action_logged('manifest_label_delete'): self.deleteResponse(ManageRepositoryManifestLabel,