mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Renamed async_credential to credential (#2648)
This commit is contained in:
@@ -152,7 +152,7 @@ def test_azure_ai_client_init_auto_create_client(
|
||||
client = AzureAIClient(
|
||||
project_endpoint=azure_ai_unit_test_env["AZURE_AI_PROJECT_ENDPOINT"],
|
||||
model_deployment_name=azure_ai_unit_test_env["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
|
||||
async_credential=mock_azure_credential,
|
||||
credential=mock_azure_credential,
|
||||
agent_name="test-agent",
|
||||
)
|
||||
|
||||
@@ -171,11 +171,11 @@ def test_azure_ai_client_init_missing_project_endpoint() -> None:
|
||||
mock_settings.return_value.model_deployment_name = "test-model"
|
||||
|
||||
with pytest.raises(ServiceInitializationError, match="Azure AI project endpoint is required"):
|
||||
AzureAIClient(async_credential=MagicMock())
|
||||
AzureAIClient(credential=MagicMock())
|
||||
|
||||
|
||||
def test_azure_ai_client_init_missing_credential(azure_ai_unit_test_env: dict[str, str]) -> None:
|
||||
"""Test AzureAIClient.__init__ when async_credential is missing and no project_client provided."""
|
||||
"""Test AzureAIClient.__init__ when credential is missing and no project_client provided."""
|
||||
with pytest.raises(
|
||||
ServiceInitializationError, match="Azure credential is required when project_client is not provided"
|
||||
):
|
||||
@@ -191,7 +191,7 @@ def test_azure_ai_client_init_validation_error(mock_azure_credential: MagicMock)
|
||||
mock_settings.side_effect = ValidationError.from_exception_data("test", [])
|
||||
|
||||
with pytest.raises(ServiceInitializationError, match="Failed to create Azure AI settings"):
|
||||
AzureAIClient(async_credential=mock_azure_credential)
|
||||
AzureAIClient(credential=mock_azure_credential)
|
||||
|
||||
|
||||
async def test_azure_ai_client_get_agent_reference_or_create_existing_version(
|
||||
@@ -320,7 +320,7 @@ async def test_azure_ai_client_prepare_options_with_application_endpoint(
|
||||
client = AzureAIClient(
|
||||
project_endpoint=endpoint,
|
||||
model_deployment_name="test-model",
|
||||
async_credential=mock_azure_credential,
|
||||
credential=mock_azure_credential,
|
||||
agent_name="test-agent",
|
||||
agent_version="1",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user