From 67ce8e57e4400f6734a999b40ccd8c3f6a489094 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Sat, 4 Jun 2016 13:16:21 +0800 Subject: support 'GET /dashboard/v1/projects' REST api in testAPI add get_dashboard_projects() in dashboard_utils.py add DashboardProjectHandler in dashboard_handlers.py add router mapping in url_mappings.py add file test_dashboard_project.py to do the unittest JIRA: FUNCTEST-292 Change-Id: I51ad8dd26abbd8d43c656c8b03ff302227255d11 Signed-off-by: SerenaFeng --- .../tests/unit/test_dashboard_project.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils/test/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py (limited to 'utils/test/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py') diff --git a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py new file mode 100644 index 000000000..f9d2015be --- /dev/null +++ b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py @@ -0,0 +1,20 @@ +import json + +from opnfv_testapi.common.constants import HTTP_OK +from test_base import TestBase + + +class TestDashboardProjectBase(TestBase): + def setUp(self): + super(TestDashboardProjectBase, self).setUp() + self.basePath = '/dashboard/v1/projects' + self.list_res = None + self.projects = ['bottlenecks', 'doctor', 'functest', + 'promise', 'qtip', 'vsperf', 'yardstick'] + + +class TestDashboardProjectGet(TestDashboardProjectBase): + def test_list(self): + code, body = self.get() + self.assertEqual(code, HTTP_OK) + self.assertItemsEqual(self.projects, json.loads(body)) -- cgit 1.2.3-korg