Skip to content

Commit

Permalink
chore: added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Aug 26, 2021
1 parent f0aa815 commit c902f07
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_Dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,22 @@ def test_create_dashboard_with_cell(self):
self.assertIsNotNone(cell.id)
view = cells_service.get_dashboards_id_cells_id_view(dashboard_id=dashboard.id, cell_id=cell.id)
self.assertEqual(view.name, f"Cell_{unique_id}_IT")

def test_get_dashboard_with_cell_with_properties(self):
unique_id = str(datetime.datetime.now().timestamp())

dashboard = self.dashboards_service.post_dashboards(
create_dashboard_request=CreateDashboardRequest(org_id=self.find_my_org().id,
name=f"Dashboard_{unique_id}_IT"))

# create cell
CellsService(self.client.api_client).post_dashboards_id_cells(
dashboard_id=dashboard.id, create_cell=CreateCell(name=f"Cell_{unique_id}_IT", h=3, w=12))

# retrieve dashboard
dashboard = self.dashboards_service.get_dashboards_id(dashboard.id)

from influxdb_client import DashboardWithViewProperties, CellWithViewProperties
self.assertEqual(DashboardWithViewProperties, type(dashboard))
self.assertEqual(1, len(dashboard.cells))
self.assertEqual(CellWithViewProperties, type(dashboard.cells[0]))

0 comments on commit c902f07

Please sign in to comment.