Skip to content

Commit c902f07

Browse files
committed
chore: added test case
1 parent f0aa815 commit c902f07

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_Dashboards.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,22 @@ def test_create_dashboard_with_cell(self):
3131
self.assertIsNotNone(cell.id)
3232
view = cells_service.get_dashboards_id_cells_id_view(dashboard_id=dashboard.id, cell_id=cell.id)
3333
self.assertEqual(view.name, f"Cell_{unique_id}_IT")
34+
35+
def test_get_dashboard_with_cell_with_properties(self):
36+
unique_id = str(datetime.datetime.now().timestamp())
37+
38+
dashboard = self.dashboards_service.post_dashboards(
39+
create_dashboard_request=CreateDashboardRequest(org_id=self.find_my_org().id,
40+
name=f"Dashboard_{unique_id}_IT"))
41+
42+
# create cell
43+
CellsService(self.client.api_client).post_dashboards_id_cells(
44+
dashboard_id=dashboard.id, create_cell=CreateCell(name=f"Cell_{unique_id}_IT", h=3, w=12))
45+
46+
# retrieve dashboard
47+
dashboard = self.dashboards_service.get_dashboards_id(dashboard.id)
48+
49+
from influxdb_client import DashboardWithViewProperties, CellWithViewProperties
50+
self.assertEqual(DashboardWithViewProperties, type(dashboard))
51+
self.assertEqual(1, len(dashboard.cells))
52+
self.assertEqual(CellWithViewProperties, type(dashboard.cells[0]))

0 commit comments

Comments
 (0)