mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
test_dynamic_azure_params
This commit is contained in:
parent
55ea2370ba
commit
c010cdef59
1 changed files with 5 additions and 5 deletions
|
@ -4364,14 +4364,14 @@ async def test_dynamic_azure_params(stream, sync_mode):
|
||||||
|
|
||||||
## recreate mock client
|
## recreate mock client
|
||||||
if sync_mode:
|
if sync_mode:
|
||||||
mock_client = MagicMock(return_value="Hello world!")
|
new_mock_client = MagicMock(return_value="Hello world!")
|
||||||
else:
|
else:
|
||||||
mock_client = AsyncMock(return_value="Hello world!")
|
new_mock_client = AsyncMock(return_value="Hello world!")
|
||||||
|
|
||||||
## CHECK IF NEW CLIENT IS USED (PARAM CHANGE)
|
## CHECK IF NEW CLIENT IS USED (PARAM CHANGE)
|
||||||
with patch.object(
|
with patch.object(
|
||||||
client.chat.completions.with_raw_response, "create", new=mock_client
|
client.chat.completions.with_raw_response, "create", new=new_mock_client
|
||||||
) as mock_client:
|
) as new_mock_client:
|
||||||
try:
|
try:
|
||||||
if sync_mode:
|
if sync_mode:
|
||||||
_ = completion(
|
_ = completion(
|
||||||
|
@ -4393,7 +4393,7 @@ async def test_dynamic_azure_params(stream, sync_mode):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mock_client.assert_not_called()
|
new_mock_client.assert_called()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue