Skip to content

Commit ac8d8c0

Browse files
committed
fix tests
1 parent b0c18b3 commit ac8d8c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/blueprints/test_guards.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,11 @@ def test_openai_v1_chat_completions__raises_404(mocker):
634634
return_value=mock_guard,
635635
)
636636
mocker.patch("guardrails_api.blueprints.guards.CacheClient.set")
637-
# expect 404 HttpError
638-
with pytest.raises(Exception) as e:
639-
openai_v1_chat_completions("My%20Guard's%20Name")
640-
assert str(e.value) == '404 Not Found: Guard not found'
637+
638+
response = openai_v1_chat_completions("My%20Guard's%20Name")
639+
assert response[1] == 404
640+
assert response[0]["message"] == 'NotFound'
641+
641642

642643
mock_get_guard.assert_called_once_with("My Guard's Name")
643644

0 commit comments

Comments
 (0)