From d41c33eb91e6890de80826eba98dcc80e9e1994a Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 9 Apr 2021 11:00:06 -0700 Subject: Update manifest API endpoints * Add validation for manifest name * Always return an array for manifests even if empty * Add missing return in df handler when returning error. Caused an additional null to be written to client crashing python decoder. When c/image is refactored to include manifests, manifest endpoints should be revisited. Signed-off-by: Jhon Honce --- test/apiv2/rest_api/test_rest_v2_0_0.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/apiv2') diff --git a/test/apiv2/rest_api/test_rest_v2_0_0.py b/test/apiv2/rest_api/test_rest_v2_0_0.py index e3874c182..97336cb71 100644 --- a/test/apiv2/rest_api/test_rest_v2_0_0.py +++ b/test/apiv2/rest_api/test_rest_v2_0_0.py @@ -727,10 +727,13 @@ class TestApi(unittest.TestCase): start = json.loads(r.text) self.assertGreater(len(start["Errs"]), 0, r.text) + def test_manifest_409(self): + r = requests.post(_url("/manifests/create"), params={"name": "ThisIsAnInvalidImage"}) + self.assertEqual(r.status_code, 400, r.text) + def test_df(self): r = requests.get(_url("/system/df")) self.assertEqual(r.status_code, 200, r.text) - if __name__ == "__main__": unittest.main() -- cgit v1.2.3-54-g00ecf