2022-08-03 12:35:48 +02:00
|
|
|
import unittest
|
|
|
|
|
2023-05-25 21:26:54 +02:00
|
|
|
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):
|
2023-05-25 21:26:54 +02:00
|
|
|
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):
|
2023-05-25 21:26:54 +02:00
|
|
|
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()
|