Skip to content

Commit 9a63e6f

Browse files
author
Arivunidhi A
committed
test: add Azure OpenAI validation tests
1 parent a6d7475 commit 9a63e6f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chromadb/test/ef/test_openai_ef.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from chromadb.utils.embedding_functions.openai_embedding_function import (
66
OpenAIEmbeddingFunction,
77
)
8+
from chromadb.errors import InvalidArgumentError
89

910

1011
def test_with_embedding_dimensions() -> None:
@@ -41,7 +42,7 @@ def test_with_incorrect_api_key() -> None:
4142
def test_azure_requires_deployment_id() -> None:
4243
"""Azure OpenAI should require deployment_id parameter."""
4344
pytest.importorskip("openai", reason="openai not installed")
44-
with pytest.raises(ValueError, match="deployment_id must be specified"):
45+
with pytest.raises(InvalidArgumentError, match="deployment_id must be specified"):
4546
OpenAIEmbeddingFunction(
4647
api_key="test_key",
4748
api_type="azure",
@@ -54,7 +55,7 @@ def test_azure_requires_deployment_id() -> None:
5455
def test_azure_requires_api_version() -> None:
5556
"""Azure OpenAI should require api_version parameter."""
5657
pytest.importorskip("openai", reason="openai not installed")
57-
with pytest.raises(ValueError, match="api_version must be specified"):
58+
with pytest.raises(InvalidArgumentError, match="api_version must be specified"):
5859
OpenAIEmbeddingFunction(
5960
api_key="test_key",
6061
api_type="azure",
@@ -67,7 +68,7 @@ def test_azure_requires_api_version() -> None:
6768
def test_azure_requires_api_base() -> None:
6869
"""Azure OpenAI should require api_base parameter."""
6970
pytest.importorskip("openai", reason="openai not installed")
70-
with pytest.raises(ValueError, match="api_base must be specified"):
71+
with pytest.raises(InvalidArgumentError, match="api_base must be specified"):
7172
OpenAIEmbeddingFunction(
7273
api_key="test_key",
7374
api_type="azure",

0 commit comments

Comments
 (0)