@@ -40,29 +40,28 @@ def test_collect_datasource_items_variable_all():
4040
4141def test_connect_success ():
4242 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
4746
4847
4948def test_connect_failure ():
5049 wtf = GrafanaWtf ("http://localhost:1234" )
5150 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" )
5453
5554
5655@patch ("grafana_client.client.GrafanaClient.__getattr__" )
5756def test_connect_version (mock_get ):
5857 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" } }
6059 wtf = GrafanaWtf ("http://localhost:1234" )
6160 assert wtf .version == "9.0.1"
6261
6362
6463def test_connect_non_json_response ():
6564 wtf = GrafanaWtf ("https://example.org/" )
6665 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