The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(image_gen): expect no model in Azure image edit multipart (#26316)
Sameer Kankute41ac026fc134
diff --git a/litellm/llms/azure/image_edit/transformation.py b/litellm/llms/azure/image_edit/transformation.pyindex ac2fe2cf605..321c2dee4e8 100644--- a/litellm/llms/azure/image_edit/transformation.py+++ b/litellm/llms/azure/image_edit/transformation.py@@ -1,4 +1,4 @@-from typing import Dict, Optional, cast+from typing import Optional, castimport httpxdiff --git a/tests/image_gen_tests/test_image_edits.py b/tests/image_gen_tests/test_image_edits.pyindex 3504065a109..dcb04c597e2 100644--- a/tests/image_gen_tests/test_image_edits.py+++ b/tests/image_gen_tests/test_image_edits.py@@ -244,7 +244,7 @@ async def test_openai_image_edit_with_bytesio():@pytest.mark.asyncioasync def test_azure_image_edit_litellm_sdk():"""Test Azure image edit with mocked httpx request to validate request body and URL"""- from litellm import image_edit, aimage_edit+ from litellm import aimage_edit# Mock response for Azure image editmock_response = {@@ -316,12 +316,11 @@ async def test_azure_image_edit_litellm_sdk():list(form_data.keys()) if hasattr(form_data, "keys") else "Not a dict",)- # Validate that model and prompt are in the form data- assert "model" in form_data, "model should be in form data"- assert "prompt" in form_data, "prompt should be in form data"+ # Deployment is in the URL path; Azure rejects model in multipart for this route.assert (- form_data["model"] == "gpt-image-1"- ), f"Expected model 'gpt-image-1', got {form_data['model']}"+ "model" not in form_data+ ), "model must not be in form data for Azure /openai/deployments/.../images/edits"+ assert "prompt" in form_data, "prompt should be in the form data"assert (prompt.strip() in form_data["prompt"]), f"Expected prompt to contain '{prompt.strip()}'"