@@ -40,29 +40,28 @@ def test_collect_datasource_items_variable_all():
40
40
41
41
def test_connect_success ():
42
42
wtf = GrafanaWtf ("https://play.grafana.org" )
43
- health = wtf .health
44
- assert "commit" in health
45
- assert "version" in health
46
- assert health .database == "ok"
43
+ build_info = wtf .build_info
44
+ assert "commit" in build_info
45
+ assert "version" in build_info
47
46
48
47
49
48
def test_connect_failure ():
50
49
wtf = GrafanaWtf ("http://localhost:1234" )
51
50
with pytest .raises (ConnectionError ) as ex :
52
- _ = wtf .health
53
- assert ex .match ("The request to http://localhost:1234/api/health failed" )
51
+ _ = wtf .build_info
52
+ assert ex .match ("The request to http://localhost:1234/api/frontend/settings failed" )
54
53
55
54
56
55
@patch ("grafana_client.client.GrafanaClient.__getattr__" )
57
56
def test_connect_version (mock_get ):
58
57
mock_get .return_value = Mock ()
59
- mock_get .return_value .return_value = {"commit " : "14e988bd22" , "database" : "ok " , "version " : "9.0.1" }
58
+ mock_get .return_value .return_value = {"buildInfo " : { "version" : "9.0.1 " , "commit " : "14e988bd22" } }
60
59
wtf = GrafanaWtf ("http://localhost:1234" )
61
60
assert wtf .version == "9.0.1"
62
61
63
62
64
63
def test_connect_non_json_response ():
65
64
wtf = GrafanaWtf ("https://example.org/" )
66
65
with pytest .raises (ConnectionError ) as ex :
67
- _ = wtf .health
68
- assert ex .match ("The request to https://example.org/api/health failed" )
66
+ _ = wtf .build_info
67
+ assert ex .match ("The request to https://example.org/api/frontend/settings failed" )
0 commit comments