Skip to content

Commit d3d131e

Browse files
committed
fixed bad tests
1 parent 89f0159 commit d3d131e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/unit/test_actions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from datetime import datetime
22

33
import pytest
4-
from groundlight import ExperimentalApi
4+
from groundlight import ExperimentalApi, ApiException
55
from groundlight_openapi_client.exceptions import NotFoundException
66

77

@@ -138,9 +138,9 @@ def test_create_alert_webhook_action_with_invalid_payload_template(gl_experiment
138138
url="https://groundlight.ai", include_image=True, payload_template=payload_template
139139
)
140140

141-
with pytest.raises(Exception) as e:
141+
with pytest.raises(ApiException) as e:
142142
gl_experimental.create_alert(det, f"test_alert_{name}", condition, webhook_actions=webhook_action)
143-
assert e.value.status_code == 400
143+
assert e.value.status == 400
144144

145145
payload_template = gl_experimental.make_payload_template(
146146
"This should not be a valid payload, it's valid jinja but won't produce valid json"
@@ -149,6 +149,6 @@ def test_create_alert_webhook_action_with_invalid_payload_template(gl_experiment
149149
url="https://groundlight.ai", include_image=True, payload_template=payload_template
150150
)
151151

152-
with pytest.raises(Exception) as e:
152+
with pytest.raises(ApiException) as e:
153153
gl_experimental.create_alert(det, f"test_alert_{name}", condition, webhook_actions=webhook_action)
154-
assert e.value.status_code == 400
154+
assert e.value.status == 400

0 commit comments

Comments
 (0)