From 3621c7cb8b1041f43ec12b889b8c339ce8479079 Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Tue, 14 Jan 2020 10:00:55 -0500 Subject: [PATCH] Fix test --- tests/integration/api/test_api.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/integration/api/test_api.py b/tests/integration/api/test_api.py index 1e5888126..70fefa36b 100644 --- a/tests/integration/api/test_api.py +++ b/tests/integration/api/test_api.py @@ -555,7 +555,16 @@ def test_monitor_can_delete(self): "deleted_monitor_id": monitor["id"] } - def test_monitor_can_delete(self): + def test_monitor_can_delete_with_force(self): + # Create a monitor. + query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100" + options = { + "silenced": {"*": int(time.time()) + 60 * 60}, + "notify_no_data": False, + } + monitor = dog.Monitor.create(type="metric alert", query=query, options=options) + monitor_ids = [monitor["id"]] + # Create a monitor-based SLO. name = "test SLO {}".format(time.time()) thresholds = [{"timeframe": "7d", "target": 90}] @@ -568,10 +577,8 @@ def test_monitor_can_delete(self): # Check if you can delete the monitor. options = {"force": True} - monitor_ids = [monitor["id"]] - assert dog.Monitor.can_delete(monitor_ids=monitor_ids, options=options) == { - "data": {"ok": monitor_ids}, - "errors": None, + assert dog.Monitor.delete([monitor["id"]], options=options) == { + "deleted_monitor_id": monitor["id"] } def test_service_level_objective_crud(self):