Skip to content

Commit 1f7077a

Browse files
tests for dashboards without tags
1 parent bbd41df commit 1f7077a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

metadata-ingestion/tests/unit/grafana/test_grafana_models.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ def test_dashboard_nested_panels():
8888
assert dashboard.panels[1].title == "Top Level Panel"
8989

9090

91+
def test_dashboard_without_tags():
92+
"""Test that dashboards without tags field validate correctly (default to empty list)"""
93+
dashboard_data = {
94+
"dashboard": {
95+
"uid": "dash1",
96+
"title": "Test Dashboard",
97+
"description": "Test Description",
98+
"version": "1",
99+
"panels": [],
100+
"timezone": "utc",
101+
"schemaVersion": "1.0",
102+
"meta": {"folderId": "123"},
103+
}
104+
}
105+
106+
dashboard = Dashboard.model_validate(dashboard_data)
107+
assert dashboard.uid == "dash1"
108+
assert dashboard.title == "Test Dashboard"
109+
assert dashboard.tags == []
110+
111+
91112
def test_folder():
92113
folder_data = {"id": "1", "title": "Test Folder", "description": "Test Description"}
93114

0 commit comments

Comments
 (0)