mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix(tests): set status_code=200 on JWT mocks and pass pii_tokens through data in presidio test
This commit is contained in:
parent
3fb9c8e185
commit
b69f687a4f
2 changed files with 4 additions and 3 deletions
|
|
@ -286,8 +286,6 @@ async def test_output_parsing():
|
|||
}
|
||||
]
|
||||
|
||||
pii_masking.pii_tokens = {"<PERSON>": "Jane Doe", "<PHONE_NUMBER>": "034453334"}
|
||||
|
||||
response = mock_completion(
|
||||
model="gpt-3.5-turbo",
|
||||
messages=filtered_message,
|
||||
|
|
@ -296,7 +294,8 @@ async def test_output_parsing():
|
|||
new_response = await pii_masking.async_post_call_success_hook(
|
||||
user_api_key_dict=UserAPIKeyAuth(),
|
||||
data={
|
||||
"messages": [{"role": "system", "content": "You are an helpfull assistant"}]
|
||||
"messages": [{"role": "system", "content": "You are an helpfull assistant"}],
|
||||
"pii_tokens": {"<PERSON>": "Jane Doe", "<PHONE_NUMBER>": "034453334"},
|
||||
},
|
||||
response=response,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1559,6 +1559,7 @@ async def test_resolve_jwks_url_caches_resolved_jwks_uri():
|
|||
jwks_url = "https://login.microsoftonline.com/tenant/discovery/keys"
|
||||
|
||||
mock_response = MagicMock()
|
||||
mock_response.status_code = 200
|
||||
mock_response.json.return_value = {"jwks_uri": jwks_url}
|
||||
|
||||
with patch.object(handler.http_handler, "get", new_callable=AsyncMock, return_value=mock_response) as mock_get:
|
||||
|
|
@ -1587,6 +1588,7 @@ async def test_resolve_jwks_url_raises_if_no_jwks_uri_in_discovery_doc():
|
|||
|
||||
discovery_url = "https://example.com/.well-known/openid-configuration"
|
||||
mock_response = MagicMock()
|
||||
mock_response.status_code = 200
|
||||
mock_response.json.return_value = {"issuer": "https://example.com"} # no jwks_uri
|
||||
|
||||
with patch.object(handler.http_handler, "get", new_callable=AsyncMock, return_value=mock_response):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue