diff --git a/tests/uptime_kuma_test_case.py b/tests/uptime_kuma_test_case.py index a43e027..430ec05 100644 --- a/tests/uptime_kuma_test_case.py +++ b/tests/uptime_kuma_test_case.py @@ -80,6 +80,18 @@ class UptimeKumaTestCase(unittest.TestCase): for docker_host in docker_hosts: self.api.delete_docker_host(docker_host["id"]) + if parse_version(self.api.version) >= parse_version("1.19"): + # delete maintenances + maintenances = self.api.get_maintenances() + for maintenance in maintenances: + self.api.delete_maintenance(maintenance["id"]) + + if parse_version(self.api.version) >= parse_version("1.21"): + # delete api keys + api_keys = self.api.get_api_keys() + for api_key in api_keys: + self.api.delete_api_key(api_key["id"]) + # login again to receive initial messages self.api.disconnect() self.api = UptimeKumaApi(self.url)