Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions tests/unit/models/config/test_byok_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ def test_byok_rag_configuration_default_values() -> None:


def test_byok_rag_configuration_nondefault_values() -> None:
"""Test the ByokRag constructor."""
"""Test the ByokRag constructor.

Verify that ByokRag class accepts and stores non-default configuration values.

Asserts that rag_id, rag_type, embedding_model, embedding_dimension, and
vector_db_id match the provided inputs and that db_path is converted to a
Path.
"""

byok_rag = ByokRag(
rag_id="rag_id",
Expand Down Expand Up @@ -83,7 +90,14 @@ def test_byok_rag_configuration_empty_rag_id() -> None:


def test_byok_rag_configuration_empty_rag_type() -> None:
"""Test the ByokRag constructor."""
"""Test the ByokRag constructor.

Verify that constructing a ByokRag with an empty `rag_type` raises a validation error.

Raises:
ValidationError: if `rag_type` is an empty string; error message
includes "String should have at least 1 character".
"""

with pytest.raises(
ValidationError, match="String should have at least 1 character"
Expand Down
8 changes: 7 additions & 1 deletion tests/unit/models/config/test_quota_scheduler_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ def test_quota_scheduler_default_configuration() -> None:


def test_quota_scheduler_custom_configuration() -> None:
"""Test the custom configuration."""
"""Test the custom configuration.

Verify that QuotaSchedulerConfiguration accepts a custom period value.

Constructs a QuotaSchedulerConfiguration with period=10 and asserts the
instance is created and its period equals 10 (the input value).
"""
cfg = QuotaSchedulerConfiguration(
period=10,
database_reconnection_count=2,
Expand Down
9 changes: 8 additions & 1 deletion tests/unit/models/config/test_tls_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ def test_tls_configuration_wrong_password_path() -> None:


def test_tls_configuration_certificate_path_to_directory() -> None:
"""Test the TLS configuration loading when some path points to a directory."""
"""Test the TLS configuration loading when some path points to a directory.

Verify that TLSConfiguration raises a ValueError when a provided TLS path
points to a directory.

Raises:
ValueError: If any of the provided TLS paths does not point to a file.
"""
with pytest.raises(ValueError, match="Path does not point to a file"):
TLSConfiguration(
tls_certificate_path=Path("tests/"),
Expand Down
22 changes: 20 additions & 2 deletions tests/unit/models/config/test_user_data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ def test_user_data_collection_transcripts_enabled() -> None:


def test_user_data_collection_transcripts_disabled() -> None:
"""Test the UserDataCollection constructor for transcripts."""
"""Test the UserDataCollection constructor for transcripts.

Verify the UserDataCollection constructor raises when transcripts are
enabled but no storage is provided.

Asserts that constructing with transcripts_enabled=True and
transcripts_storage=None raises a ValueError with the message
"transcripts_storage is required when transcripts is enabled".
"""
# incorrect configuration
with pytest.raises(
ValueError,
Expand All @@ -43,7 +51,17 @@ def test_user_data_collection_transcripts_disabled() -> None:


def test_user_data_collection_wrong_directory_path() -> None:
"""Test the UserDataCollection constructor for wrong directory path."""
"""Test the UserDataCollection constructor for wrong directory path.

Verify UserDataCollection raises InvalidConfigurationError when provided
storage paths point to non-writable directories.

Ensures that enabling feedback with feedback_storage='/root' raises
InvalidConfigurationError with message "Check directory to store feedback
'/root' is not writable", and enabling transcripts with
transcripts_storage='/root' raises InvalidConfigurationError with message
"Check directory to store transcripts '/root' is not writable".
"""
with pytest.raises(
InvalidConfigurationError,
match="Check directory to store feedback '/root' is not writable",
Expand Down
Loading