Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtam committed Aug 16, 2024
1 parent b0c18b3 commit ac8d8c0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/blueprints/test_guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,11 @@ def test_openai_v1_chat_completions__raises_404(mocker):
return_value=mock_guard,
)
mocker.patch("guardrails_api.blueprints.guards.CacheClient.set")
# expect 404 HttpError
with pytest.raises(Exception) as e:
openai_v1_chat_completions("My%20Guard's%20Name")
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'


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

Expand Down

0 comments on commit ac8d8c0

Please sign in to comment.