test: delete maintenances and api keys in setUp
This commit is contained in:
parent
cc3588cf4d
commit
307b25249c
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue