diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-04 13:16:21 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-04 13:16:21 +0800 |
commit | c255322aaa2f3898b5bb53a7144e3d4e4a9b3b20 (patch) | |
tree | 0ecc1236fb420e095c08ebc6d4ee3c808ae3e6d5 /result_collection_api/opnfv_testapi/tests | |
parent | 4ab58917d2310dcc92d94a7060ac147906c9ecd6 (diff) |
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 <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/opnfv_testapi/tests')
-rw-r--r-- | result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py b/result_collection_api/opnfv_testapi/tests/unit/test_dashboard_project.py new file mode 100644 index 0000000..f9d2015 --- /dev/null +++ b/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)) |