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 3621c7c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 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 @@ -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):
Expand Down

0 comments on commit 3621c7c

Please sign in to comment.