From 38f1edd2aae0335776bbbc5dfc77f020eb2a6c84 Mon Sep 17 00:00:00 2001 From: Jacob Kozol Date: Mon, 8 Jul 2019 16:41:54 +0200 Subject: [PATCH] Add test for VALID_BLUEPRINT_NAME check Blueprint names can only contain alphanumeric characters and the characters: ._-. This test checks that an api request to create a blueprint with invalid characters in its name will return an InvalidChars error. --- test/check-api | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/check-api b/test/check-api index f4371585..ffa5c889 100755 --- a/test/check-api +++ b/test/check-api @@ -3,8 +3,6 @@ import composertest import requests import subprocess -import json - class TestApi(composertest.ComposerTestCase): """Test Composer HTTP API""" @@ -78,12 +76,11 @@ class TestApi(composertest.ComposerTestCase): "modules": [], "groups": [] } - r = self.request("POST", "/api/v0/blueprints/new", json=invalid_blueprint, check=False) self.assertEqual(r.status_code, 400) self.assertEqual(r.json(), { "status": False, - "errors": [{ "id": "InvalidChars", "code": 400, "msg": "Invalid characters in API path" }] + "errors": [{ "id": "InvalidChars", "msg": "Invalid characters in API path" }] })