Skip to content

Commit

Permalink
feat: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuksenko committed Mar 30, 2023
1 parent e57cd82 commit af42a8f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/tacticalrmm/core/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,21 @@ def test_get_meshagent_url_docker(self):
r,
"http://tactical-meshcentral:4443/meshagents?id=4&meshid=abc123&installflags=0",
)


class TestMonitoring(TacticalTestCase):
url = "/core/status/"

def setUp(self):
self.setup_client()
self.setup_coresettings()

def test_prometheus_missing_auth_header_request(self):
r = self.client.get(self.url)
self.assertEqual(r.status_code, 400)

@override_settings(MON_TOKEN="MySuperTestSecret")
def test_prometheus_correct_request(self):
header = {"Authorization": "Bearer MySuperTestSecret"}
r = self.client.get(self.url, **header)
self.assertEqual(r.status_code, 200)

0 comments on commit af42a8f

Please sign in to comment.