Skip to content

Commit 00b3655

Browse files
author
eycjur
committed
add unit test
1 parent bf06378 commit 00b3655

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
import sys
3+
4+
sys.path.insert(
5+
0, os.path.abspath("../../../../..")
6+
) # Adds the parent directory to the system path
7+
8+
from litellm.llms.azure_ai.image_edit.transformation import AzureFoundryFluxImageEditConfig
9+
10+
11+
def test_azure_ai_validate_environment():
12+
"""Test Azure AI environment validation"""
13+
config = AzureFoundryFluxImageEditConfig()
14+
15+
headers = {}
16+
config.validate_environment(headers, "FLUX.1-Kontext-pro", api_key="test-key")
17+
assert "Api-Key" in headers
18+
assert headers["Api-Key"] == "test-key"
19+
20+
21+
def test_azure_ai_url_generation():
22+
"""Test Azure AI URL generation"""
23+
config = AzureFoundryFluxImageEditConfig()
24+
25+
api_base = "https://test-endpoint.eastus2.inference.ai.azure.com"
26+
complete_url = config.get_complete_url(
27+
model="FLUX.1-Kontext-pro",
28+
api_base=api_base,
29+
litellm_params={"api_version": "2025-04-01-preview"}
30+
)
31+
expected_url = f"{api_base}/openai/deployments/FLUX.1-Kontext-pro/images/edits?api-version=2025-04-01-preview"
32+
assert complete_url == expected_url

0 commit comments

Comments
 (0)