@@ -191,18 +191,35 @@ def test_replace_dashboard_dry_run_success(ldi_resources, capsys):
191
191
assert "Dashboards: 0 hits" in captured .out
192
192
193
193
194
- def test_log_empty (capsys , caplog ):
194
+ def test_log_empty (docker_grafana , capsys , caplog ):
195
195
# Run command and capture output.
196
196
set_command ("log foobar" )
197
197
with caplog .at_level (logging .DEBUG ):
198
198
grafana_wtf .commands .run ()
199
199
captured = capsys .readouterr ()
200
200
201
201
# Verify output.
202
- assert 'Aggregating edit history for Grafana dashboard "foobar" at http://localhost:33333 ' in caplog .text
202
+ assert 'Aggregating edit history for Grafana dashboard "foobar"' in caplog .text
203
203
assert "[]" in captured .out
204
204
205
205
206
+ def test_log_all (ldi_resources , capsys , caplog ):
207
+
208
+ # Only provision specific dashboard(s).
209
+ ldi_resources (dashboards = ["tests/grafana/dashboards/ldi-v27.json" , "tests/grafana/dashboards/ldi-v33.json" ])
210
+
211
+ # Run command and capture output.
212
+ set_command ("log" )
213
+ with caplog .at_level (logging .DEBUG ):
214
+ grafana_wtf .commands .run ()
215
+ captured = capsys .readouterr ()
216
+
217
+ # Verify output.
218
+ assert 'Aggregating edit history for multiple Grafana dashboards' in caplog .text
219
+ history = json .loads (captured .out )
220
+ assert len (history ) == 3
221
+
222
+
206
223
def test_log_json_success (ldi_resources , capsys , caplog ):
207
224
# Only provision specific dashboard(s).
208
225
ldi_resources (dashboards = ["tests/grafana/dashboards/ldi-v27.json" , "tests/grafana/dashboards/ldi-v33.json" ])
@@ -214,7 +231,7 @@ def test_log_json_success(ldi_resources, capsys, caplog):
214
231
captured = capsys .readouterr ()
215
232
216
233
# Verify output.
217
- assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz" at http://localhost:33333 ' in caplog .text
234
+ assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz"' in caplog .text
218
235
219
236
reference = {
220
237
# "datetime": "2021-09-29T17:32:23Z",
@@ -244,7 +261,7 @@ def test_log_tabular_success(ldi_resources, capsys, caplog):
244
261
captured = capsys .readouterr ()
245
262
246
263
# Verify output.
247
- assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz" at http://localhost:33333 ' in caplog .text
264
+ assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz"' in caplog .text
248
265
249
266
reference = """
250
267
| Notes: n/a<br/>[Testdrive » luftdaten.info generic trend v27](http://localhost:33333/d/ioUrPwQiz/luftdaten-info-generic-trend-v27) | User: admin<br/>Date: xxxx-xx-xxTxx:xx:xxZ |
0 commit comments