We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0c18b3 commit ac8d8c0Copy full SHA for ac8d8c0
tests/blueprints/test_guards.py
@@ -634,10 +634,11 @@ def test_openai_v1_chat_completions__raises_404(mocker):
634
return_value=mock_guard,
635
)
636
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'
+
+ response = openai_v1_chat_completions("My%20Guard's%20Name")
+ assert response[1] == 404
+ assert response[0]["message"] == 'NotFound'
641
642
643
mock_get_guard.assert_called_once_with("My Guard's Name")
644
0 commit comments