test_dynamic_azure_params

This commit is contained in:
Ishaan Jaff 2025-03-18 17:26:23 -07:00
parent 55ea2370ba
commit c010cdef59

View file

@ -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