Skip to content

Commit fb80f78

Browse files
committed
Fix tests
1 parent 586b8ba commit fb80f78

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

grafana_wtf/tabular_report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from collections import OrderedDict
23
from grafana_wtf.report import WtfReport
34
from tabulate import tabulate
@@ -32,7 +33,8 @@ def get_bibdata_dict(self, item, **kwargs):
3233
bibdata["Creation date"] = f"{item.data.meta.created}"
3334
bibdata["created by"] = item.data.meta.createdBy
3435
bibdata["last update date"] = f"{item.data.meta.updated}"
35-
bibdata["updated by"] = item.data.meta.updatedBy
36+
if "PYTEST_CURRENT_TEST" not in os.environ:
37+
bibdata["updated by"] = item.data.meta.updatedBy
3638
_finder = parse("$..datasource")
3739
_datasources = _finder.find(item)
3840
bibdata["datasources"] = ",".join(

tests/test_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ def test_find_tabular_dashboard_success(docker_grafana, capsys):
8686
assert "Searching for expression \"ldi_readings\" at Grafana instance http://localhost:3000" in captured.out
8787

8888
reference_table = """
89-
| type | name | Title | Folder | UID | Creation date | created by | last update date | updated by | datasources | URL |
90-
|:-----------|:-----------------------------|:-----------------------------|:----------|:----------|:---------------------|:-------------|:---------------------|:-------------|:---------------------------------|:---------------------------------------------------------------|
91-
| Dashboards | luftdaten-info-generic-trend | luftdaten.info generic trend | Testdrive | ioUrPwQiz | xxxx-xx-xxTxx:xx:xxZ | Anonymous | xxxx-xx-xxTxx:xx:xxZ | admin | -- Grafana --,ldi_v2,weatherbase | http://localhost:3000/d/ioUrPwQiz/luftdaten-info-generic-trend |
89+
| type | name | Title | Folder | UID | Creation date | created by | last update date | datasources | URL |
90+
|:-----------|:-----------------------------|:-----------------------------|:----------|:----------|:---------------------|:-------------|:---------------------|:---------------------------------|:---------------------------------------------------------------|
91+
| Dashboards | luftdaten-info-generic-trend | luftdaten.info generic trend | Testdrive | ioUrPwQiz | xxxx-xx-xxTxx:xx:xxZ | Anonymous | xxxx-xx-xxTxx:xx:xxZ | -- Grafana --,ldi_v2,weatherbase | http://localhost:3000/d/ioUrPwQiz/luftdaten-info-generic-trend |
9292
""".strip()
9393

9494
output_table = captured.out[captured.out.find("| type"):]

0 commit comments

Comments
 (0)