Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
iminoso committed Jan 14, 2020
1 parent d99d45d commit e814e30
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/integration/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}]
Expand All @@ -569,7 +578,7 @@ 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) == {
assert dog.Monitor.delete(monitor_ids=monitor_ids, options=options) == {
"data": {"ok": monitor_ids},
"errors": None,
}
Expand Down

0 comments on commit e814e30

Please sign in to comment.