From ba78cb6190dbaaad9ebf31bd2bf93510216c89b0 Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Wed, 3 Jun 2026 11:15:37 +0800 Subject: [PATCH] test(azure): cover image deployment routing --- tests/lib/test_azure.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/lib/test_azure.py b/tests/lib/test_azure.py index 52c24eba27..f159bdedc3 100644 --- a/tests/lib/test_azure.py +++ b/tests/lib/test_azure.py @@ -33,17 +33,25 @@ class MockRequestCall(Protocol): @pytest.mark.parametrize("client", [sync_client, async_client]) -def test_implicit_deployment_path(client: Client) -> None: +@pytest.mark.parametrize( + "path", + [ + "/chat/completions", + "/images/edits", + "/images/generations", + ], +) +def test_implicit_deployment_path(client: Client, path: str) -> None: req = client._build_request( FinalRequestOptions.construct( method="post", - url="/chat/completions", + url=path, json_data={"model": "my-deployment-model"}, ) ) assert ( req.url - == "https://example-resource.azure.openai.com/openai/deployments/my-deployment-model/chat/completions?api-version=2023-07-01" + == f"https://example-resource.azure.openai.com/openai/deployments/my-deployment-model{path}?api-version=2023-07-01" )