2022-08-03 12:35:48 +02:00
|
|
|
import unittest
|
|
|
|
|
2023-09-26 22:29:33 +02:00
|
|
|
from uptime_kuma_api import UptimeKumaApi
|
2022-08-03 12:35:48 +02:00
|
|
|
from uptime_kuma_test_case import UptimeKumaTestCase
|
|
|
|
|
|
|
|
|
|
|
|
class TestInfo(UptimeKumaTestCase):
|
|
|
|
def test_info(self):
|
|
|
|
info = self.api.info()
|
|
|
|
self.assertIn("version", info)
|
|
|
|
self.assertIn("latestVersion", info)
|
|
|
|
|
2023-09-26 22:29:33 +02:00
|
|
|
def test_info_with_version(self):
|
|
|
|
# If wait_events is set to 0, the first info event is normally used.
|
|
|
|
# The info event handler needs to drop this first event without a version.
|
|
|
|
self.api.logout()
|
|
|
|
self.api.disconnect()
|
|
|
|
self.api = UptimeKumaApi(self.url, wait_events=0)
|
|
|
|
self.api.login(self.username, self.password)
|
|
|
|
info = self.api.info()
|
|
|
|
self.assertIn("version", info)
|
|
|
|
|
2022-08-03 12:35:48 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|