summaryrefslogtreecommitdiffstats
path: root/result_collection_api/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'result_collection_api/tests/unit')
-rw-r--r--result_collection_api/tests/unit/test_base.py9
-rw-r--r--result_collection_api/tests/unit/test_project.py12
2 files changed, 17 insertions, 4 deletions
diff --git a/result_collection_api/tests/unit/test_base.py b/result_collection_api/tests/unit/test_base.py
index 16ed07c..44e42b7 100644
--- a/result_collection_api/tests/unit/test_base.py
+++ b/result_collection_api/tests/unit/test_base.py
@@ -2,9 +2,10 @@ import json
from tornado.web import Application
from tornado.testing import AsyncHTTPTestCase
-from resources.pod_handler import PodCLHandler, PodGURHandler
+from resources.pod_handlers import PodCLHandler, PodGURHandler
+from resources.project_handlers import ProjectCLHandler, ProjectGURHandler
from resources.handlers import VersionHandler, \
- ProjectHandler, TestcaseHandler, TestResultsHandler, DashboardHandler
+ TestcaseHandler, TestResultsHandler, DashboardHandler
from resources.models import CreateResponse
import fake_pymongo
@@ -29,8 +30,8 @@ class TestBase(AsyncHTTPTestCase):
(r"/versions", VersionHandler),
(r"/api/v1/pods", PodCLHandler),
(r"/api/v1/pods/([^/]+)", PodGURHandler),
- (r"/api/v1/projects", ProjectHandler),
- (r"/api/v1/projects/([^/]+)", ProjectHandler),
+ (r"/api/v1/projects", ProjectCLHandler),
+ (r"/api/v1/projects/([^/]+)", ProjectGURHandler),
(r"/api/v1/projects/([^/]+)/cases", TestcaseHandler),
(r"/api/v1/projects/([^/]+)/cases/([^/]+)", TestcaseHandler),
(r"/api/v1/results", TestResultsHandler),
diff --git a/result_collection_api/tests/unit/test_project.py b/result_collection_api/tests/unit/test_project.py
index c380780..b07cb7a 100644
--- a/result_collection_api/tests/unit/test_project.py
+++ b/result_collection_api/tests/unit/test_project.py
@@ -30,6 +30,18 @@ class TestProjectCreate(TestProjectBase):
(code, body) = self.create()
self.assertEqual(code, HTTP_BAD_REQUEST)
+ def test_emptyName(self):
+ req_empty = ProjectCreateRequest('')
+ (code, body) = self.create(req_empty)
+ self.assertEqual(code, HTTP_BAD_REQUEST)
+ self.assertIn('project name missing', body)
+
+ def test_noneName(self):
+ req_none = ProjectCreateRequest(None)
+ (code, body) = self.create(req_none)
+ self.assertEqual(code, HTTP_BAD_REQUEST)
+ self.assertIn('project name missing', body)
+
def test_success(self):
(code, body) = self.create_d()
self.assertEqual(code, HTTP_OK)