pre-commit tests

This commit is contained in:
Raghotham Murthy 2025-10-23 06:58:22 -07:00
parent 1885beb864
commit 66158d1999
2 changed files with 5 additions and 8 deletions

View file

@ -9,6 +9,8 @@ from llama_stack_client import LlamaStackClient
from llama_stack import LlamaStackAsLibraryClient
pytestmark = pytest.mark.skip(reason="Requires client SDK update for new provider management APIs")
class TestDynamicProviderManagement:
"""Integration tests for dynamic provider registration, update, and unregistration."""
@ -261,9 +263,7 @@ class TestDynamicProviderManagement:
# Verify error message mentions provider not found
assert "not found" in str(exc_info.value).lower() or "does not exist" in str(exc_info.value).lower()
def test_provider_lifecycle_with_inference(
self, llama_stack_client: LlamaStackAsLibraryClient | LlamaStackClient
):
def test_provider_lifecycle_with_inference(self, llama_stack_client: LlamaStackAsLibraryClient | LlamaStackClient):
"""Test full lifecycle: register, use for inference (if Ollama available), update, unregister."""
provider_id = "test-lifecycle-inference"

View file

@ -4,12 +4,11 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from datetime import UTC, datetime
from unittest.mock import AsyncMock, MagicMock, Mock, patch
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from llama_stack.apis.providers.connection import ProviderConnectionInfo, ProviderConnectionStatus, ProviderHealth
from llama_stack.apis.providers.connection import ProviderConnectionStatus, ProviderHealth
from llama_stack.core.datatypes import StackRunConfig
from llama_stack.core.providers import ProviderImpl, ProviderImplConfig
from llama_stack.core.storage.datatypes import KVStoreReference, ServerStoresConfig, SqliteKVStoreConfig, StorageConfig
@ -72,7 +71,6 @@ async def provider_impl(kvstore, tmp_path):
yield impl
@pytest.mark.asyncio
class TestDynamicProviderManagement:
"""Unit tests for dynamic provider registration, update, and unregistration."""
@ -333,7 +331,6 @@ class TestDynamicProviderManagement:
# (In reality, the health check happens during registration,
# but our mock may not have been properly called)
conn_info = provider_impl.dynamic_providers["test-inspect"]
from llama_stack.apis.providers.connection import ProviderHealth
conn_info.health = ProviderHealth.from_health_response({"status": HealthStatus.OK})