Skip to content

Commit af42a8f

Browse files
committed
feat: fixup
1 parent e57cd82 commit af42a8f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

api/tacticalrmm/core/tests.py

+18
Original file line numberDiff line numberDiff line change
@@ -500,3 +500,21 @@ def test_get_meshagent_url_docker(self):
500500
r,
501501
"http://tactical-meshcentral:4443/meshagents?id=4&meshid=abc123&installflags=0",
502502
)
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

Comments
 (0)