From c00e7626020f8f2a47e8babdb85b4d64ee80b81b Mon Sep 17 00:00:00 2001 From: Jeremy Liu Date: Fri, 24 Feb 2017 14:46:27 +0800 Subject: [PATCH] Add testcases for cloudkitty-dashboard Add a testcase for testing rating/reporting panel registration. Change-Id: Iafbe3968ee7d4bdf90dce9b23ec481d7c816ddc5 --- .../tests/test_cloudkittydashboard.py | 15 +++++++++++++-- test-requirements.txt | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cloudkittydashboard/tests/test_cloudkittydashboard.py b/cloudkittydashboard/tests/test_cloudkittydashboard.py index e7455da..3e066ed 100644 --- a/cloudkittydashboard/tests/test_cloudkittydashboard.py +++ b/cloudkittydashboard/tests/test_cloudkittydashboard.py @@ -20,10 +20,21 @@ test_cloudkittydashboard Tests for `cloudkittydashboard` module. """ +from cloudkittydashboard.dashboards.project.rating import \ + panel as rating_panel +from cloudkittydashboard.dashboards.project.reporting import \ + panel as reporting_panel from cloudkittydashboard.tests import base +import horizon class TestCloudkittydashboard(base.TestCase): - def test_something(self): - pass + def test_registered(self): + project_dashboard = horizon.get_dashboard('project') + + panel_1 = project_dashboard.get_panel('rating') + self.assertEqual(rating_panel.Project_rating, panel_1.__class__) + + panel_2 = project_dashboard.get_panel('reporting') + self.assertEqual(reporting_panel.Project_reporting, panel_2.__class__) diff --git a/test-requirements.txt b/test-requirements.txt index 15985e6..d71a81a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,6 +3,9 @@ # process, which may cause wedges in the gate later. hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0 +# Require Horizon +-e git://github.com/openstack/horizon.git#egg=horizon + coverage>=3.6 discover python-subunit>=0.0.18