Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Nov 21, 2022
1 parent 64a743a commit eb71a42
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/integration_tests/dashboards/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,22 @@ def test_get_dashboard_charts(self):
response = self.get_assert_metric(uri, "get_charts")
self.assertEqual(response.status_code, 200)
data = json.loads(response.data.decode("utf-8"))
self.assertEqual(len(data["result"]), 1)
self.assertEqual(
data["result"][0]["slice_name"], dashboard.slices[0].slice_name
)
assert len(data["result"]) == 1
result = data["result"][0]
assert set(result.keys()) == {
"cache_timeout",
"certification_details",
"certified_by",
"changed_on",
"description",
"description_markeddown",
"form_data",
"id",
"slice_name",
"slice_url",
}
assert result["id"] == dashboard.slices[0].id
assert result["slice_name"] == dashboard.slices[0].slice_name

@pytest.mark.usefixtures("create_dashboards")
def test_get_dashboard_charts_by_slug(self):
Expand Down

0 comments on commit eb71a42

Please sign in to comment.