Skip to content

Commit

Permalink
Add tests for options on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
iminoso committed Jan 13, 2020
1 parent a86bc71 commit d99d45d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/integration/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,25 @@ def test_monitor_can_delete(self):
"deleted_monitor_id": monitor["id"]
}

def test_monitor_can_delete(self):
# Create a monitor-based SLO.
name = "test SLO {}".format(time.time())
thresholds = [{"timeframe": "7d", "target": 90}]
slo = dog.ServiceLevelObjective.create(
type="monitor",
monitor_ids=monitor_ids,
thresholds=thresholds,
name=name,
)["data"][0]

# 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,
}

def test_service_level_objective_crud(self):
numerator = "sum:my.custom.metric{type:good}.as_count()"
denominator = "sum:my.custom.metric{*}.as_count()"
Expand Down

0 comments on commit d99d45d

Please sign in to comment.