Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions test/integration/test_groundlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,12 @@ def test_delete_detector(gl: Groundlight):
gl.delete_detector(detector)

# Verify the detector is actually deleted
with pytest.raises(NotFoundError):
with pytest.raises(ApiException) as exc_info:
gl.get_detector(detector.id)
err = exc_info.value
assert err.status == HTTPStatus.GONE
payload = json.loads(err.body)
assert det_id in payload.get("message", "")

# Create another detector to test deletion by ID string and that an attached image query is deleted
name2 = f"Test delete detector 2 {datetime.utcnow()}"
Expand All @@ -891,8 +895,12 @@ def test_delete_detector(gl: Groundlight):
gl.delete_detector(detector2.id)

# Verify the second detector is also deleted
with pytest.raises(NotFoundError):
with pytest.raises(ApiException) as exc_info:
gl.get_detector(detector2.id)
err = exc_info.value
assert err.status == HTTPStatus.GONE
payload = json.loads(err.body)
assert det_id in payload.get("message", "")

# Verify the image query is also deleted
with pytest.raises(NotFoundException):
Expand Down