We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e57cd82 commit af42a8fCopy full SHA for af42a8f
api/tacticalrmm/core/tests.py
@@ -500,3 +500,21 @@ def test_get_meshagent_url_docker(self):
500
r,
501
"http://tactical-meshcentral:4443/meshagents?id=4&meshid=abc123&installflags=0",
502
)
503
+
504
505
+class TestMonitoring(TacticalTestCase):
506
+ url = "/core/status/"
507
508
+ def setUp(self):
509
+ self.setup_client()
510
+ self.setup_coresettings()
511
512
+ def test_prometheus_missing_auth_header_request(self):
513
+ r = self.client.get(self.url)
514
+ self.assertEqual(r.status_code, 400)
515
516
+ @override_settings(MON_TOKEN="MySuperTestSecret")
517
+ def test_prometheus_correct_request(self):
518
+ header = {"Authorization": "Bearer MySuperTestSecret"}
519
+ r = self.client.get(self.url, **header)
520
+ self.assertEqual(r.status_code, 200)
0 commit comments