test(image_gen): expect no model in Azure image edit multipart (#26316)
Align test_azure_image_edit_litellm_sdk with deployment-scoped Azure edits. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
87cf5107e1
commit
41ac026fc1
@ -1,4 +1,4 @@
|
||||
from typing import Dict, Optional, cast
|
||||
from typing import Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
|
||||
@ -244,7 +244,7 @@ async def test_openai_image_edit_with_bytesio():
|
||||
@pytest.mark.asyncio
|
||||
async 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 edit
|
||||
mock_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()}'"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user