uptime-kuma-api/tests/test_heartbeat.py

21 lines
587 B
Python
Raw Permalink Normal View History

2022-08-03 12:35:48 +02:00
import unittest
from uptime_kuma_api import MonitorStatus
2022-08-03 12:35:48 +02:00
from uptime_kuma_test_case import UptimeKumaTestCase
class TestHeartbeat(UptimeKumaTestCase):
def test_get_heartbeats(self):
self.add_monitor()
r = self.api.get_heartbeats()
self.assertTrue(type(list(r.values())[0][0]["status"]) == MonitorStatus)
2022-08-03 12:35:48 +02:00
def test_get_important_heartbeats(self):
self.add_monitor()
r = self.api.get_important_heartbeats()
self.assertTrue(type(list(r.values())[0][0]["status"]) == MonitorStatus)
2022-08-03 12:35:48 +02:00
if __name__ == '__main__':
unittest.main()