Skip to content

Commit 291d220

Browse files
are-cesclaude
andcommitted
LCORE-2437: add test for unsupported rag_type and narrow pylint suppression
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 94b5cf4 commit 291d220

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

tests/unit/models/config/test_byok_rag.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Unit tests for ByokRag model."""
22

3-
# pylint: disable=no-member
4-
53
import pytest
64
from pydantic import ValidationError
75

@@ -225,7 +223,7 @@ def test_byok_rag_pgvector_defaults() -> None:
225223
assert store.port == "${env.POSTGRES_PORT}"
226224
assert store.db == "${env.POSTGRES_DATABASE}"
227225
assert store.user == "${env.POSTGRES_USER}"
228-
assert store.password.get_secret_value() == "${env.POSTGRES_PASSWORD}"
226+
assert store.password.get_secret_value() == "${env.POSTGRES_PASSWORD}" # pylint: disable=no-member
229227
assert store.db_path is None
230228

231229

@@ -245,7 +243,7 @@ def test_byok_rag_pgvector_custom_connection_fields() -> None:
245243
assert store.port == "5433"
246244
assert store.db == "my_knowledge"
247245
assert store.user == "admin"
248-
assert store.password.get_secret_value() == "secret"
246+
assert store.password.get_secret_value() == "secret" # pylint: disable=no-member
249247

250248

251249
def test_byok_rag_pgvector_partial_overrides() -> None:

tests/unit/test_llama_stack_configuration.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import yaml
88

99
from llama_stack_configuration import (
10+
_build_vector_io_config,
1011
construct_models_section,
1112
construct_storage_backends_section,
1213
construct_vector_io_providers_section,
@@ -878,3 +879,14 @@ def test_enrich_solr_user_chunk_filter_query_is_conjoined() -> None:
878879
assert provider["config"]["chunk_window_config"]["chunk_filter_query"] == (
879880
"is_chunk:true AND product:ansible"
880881
)
882+
883+
884+
# =============================================================================
885+
# Test _build_vector_io_config
886+
# =============================================================================
887+
888+
889+
def test_build_vector_io_config_rejects_unsupported_rag_type() -> None:
890+
"""Test that an unsupported rag_type raises ValueError."""
891+
with pytest.raises(ValueError, match="Unsupported rag_type 'remote::chromadb'"):
892+
_build_vector_io_config("remote::chromadb", "some_backend", {})

0 commit comments

Comments
 (0)