@@ -120,6 +120,7 @@ def test_redash_dashboard_crawler_snapshot_persists_dashboards(mock_backend) ->
120
120
),
121
121
]
122
122
ws .dashboards .list .side_effect = lambda : (dashboard for dashboard in dashboards ) # Expects an iterator
123
+ ws .dashboards .get .side_effect = lambda dashboard_id : dashboards [0 ]
123
124
crawler = RedashDashboardCrawler (ws , mock_backend , "test" )
124
125
125
126
crawler .snapshot ()
@@ -155,6 +156,7 @@ def list_dashboards() -> Iterator[SdkRedashDashboard]:
155
156
raise TooManyRequests ("Exceeded API limit" )
156
157
157
158
ws .dashboards .list .side_effect = list_dashboards
159
+ ws .dashboards .get .side_effect = lambda dashboard_id : SdkRedashDashboard (id = dashboard_id )
158
160
crawler = RedashDashboardCrawler (ws , mock_backend , "test" )
159
161
160
162
with caplog .at_level (logging .WARNING , logger = "databricks.labs.ucx.assessment.dashboards" ):
@@ -170,6 +172,7 @@ def test_redash_dashboard_crawler_stops_when_debug_listing_upper_limit_reached(m
170
172
ws = create_autospec (WorkspaceClient )
171
173
dashboards = [SdkRedashDashboard (id = "did1" ), SdkRedashDashboard (id = "did2" )]
172
174
ws .dashboards .list .side_effect = lambda : (dashboard for dashboard in dashboards )
175
+ ws .dashboards .get .side_effect = lambda dashboard_id : SdkRedashDashboard (id = dashboard_id )
173
176
crawler = RedashDashboardCrawler (ws , mock_backend , "test" , debug_listing_upper_limit = 1 )
174
177
175
178
crawler .snapshot ()
@@ -274,6 +277,7 @@ def test_redash_dashboard_crawler_snapshot_skips_dashboard_without_id(mock_backe
274
277
ws = create_autospec (WorkspaceClient )
275
278
dashboards = [SdkRedashDashboard (id = "did1" ), SdkRedashDashboard ()] # Second misses dashboard id
276
279
ws .dashboards .list .side_effect = lambda : (dashboard for dashboard in dashboards ) # Expects an iterator
280
+ ws .dashboards .get .side_effect = lambda dashboard_id : SdkRedashDashboard (id = dashboard_id )
277
281
crawler = RedashDashboardCrawler (ws , mock_backend , "test" )
278
282
279
283
crawler .snapshot ()
0 commit comments