From 19c2c3b81cd9f10d9e01deb595a5a5bcb87af2b1 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 25 Sep 2024 18:29:54 +1000 Subject: [PATCH] feedback Signed-off-by: Adrian Cole --- tests/providers/conftest.py | 4 ++-- tests/providers/test_azure.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/providers/conftest.py b/tests/providers/conftest.py index 8da81bc..d0ac648 100644 --- a/tests/providers/conftest.py +++ b/tests/providers/conftest.py @@ -40,7 +40,7 @@ def default_azure_env(monkeypatch): When running VCR tests for the first time or after deleting a cassette recording, set required environment variables, so that real requests don't - fail. Subsequent runs use the recorded data, so don't them. + fail. Subsequent runs use the recorded data, so don't need them. """ if "AZURE_CHAT_COMPLETIONS_HOST_NAME" not in os.environ: monkeypatch.setenv("AZURE_CHAT_COMPLETIONS_HOST_NAME", AZURE_ENDPOINT) @@ -79,7 +79,7 @@ def scrub_request_url(request): This scrubs sensitive request data in provider-specific way. Note that headers are case-sensitive! """ - if "openai" in request.uri: + if "openai.azure.com" in request.uri: request.uri = re.sub(r"https://[^/]+", AZURE_ENDPOINT, request.uri) request.uri = re.sub(r"/deployments/[^/]+", f"/deployments/{AZURE_DEPLOYMENT_NAME}", request.uri) request.headers["host"] = AZURE_ENDPOINT.replace("https://", "") diff --git a/tests/providers/test_azure.py b/tests/providers/test_azure.py index 1b8754b..968d858 100644 --- a/tests/providers/test_azure.py +++ b/tests/providers/test_azure.py @@ -22,4 +22,4 @@ def test_azure_complete_integration(): reply = complete(AzureProvider, AZURE_MODEL) assert reply[0].content is not None - print("Complete content from Azure:", reply[0].content) + print("Completion content from Azure:", reply[0].content)