From 6f93907e0fccd627da6e119086d0ec3a8e9573cc Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 5 Jan 2026 09:11:50 +0100 Subject: [PATCH 1/4] Updated docstrings in byok_rag.py --- tests/unit/models/config/test_byok_rag.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/unit/models/config/test_byok_rag.py b/tests/unit/models/config/test_byok_rag.py index 11db290ce..fed3e5062 100644 --- a/tests/unit/models/config/test_byok_rag.py +++ b/tests/unit/models/config/test_byok_rag.py @@ -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", @@ -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" From 058cc38474be7ac4ee593127e0e0efb4b13130a4 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 5 Jan 2026 09:12:04 +0100 Subject: [PATCH 2/4] Updated docstrings in quota scheduler config tests --- tests/unit/models/config/test_quota_scheduler_config.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unit/models/config/test_quota_scheduler_config.py b/tests/unit/models/config/test_quota_scheduler_config.py index 0a424bae9..d34f42287 100644 --- a/tests/unit/models/config/test_quota_scheduler_config.py +++ b/tests/unit/models/config/test_quota_scheduler_config.py @@ -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, From 2e32ac03fb4f79566a77272b2a335d90c5add213 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 5 Jan 2026 09:12:17 +0100 Subject: [PATCH 3/4] Updated docstrings in TLS configuration unit tests --- tests/unit/models/config/test_tls_configuration.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/unit/models/config/test_tls_configuration.py b/tests/unit/models/config/test_tls_configuration.py index 63633f422..503ae4ea8 100644 --- a/tests/unit/models/config/test_tls_configuration.py +++ b/tests/unit/models/config/test_tls_configuration.py @@ -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/"), From 72b9aea5b200a5bea6b9902bdd3b39f2cbabd0e5 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 5 Jan 2026 09:12:29 +0100 Subject: [PATCH 4/4] Updated docstrings in user data collection unit tests --- .../config/test_user_data_collection.py | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/unit/models/config/test_user_data_collection.py b/tests/unit/models/config/test_user_data_collection.py index 602ce810e..36e56d2f0 100644 --- a/tests/unit/models/config/test_user_data_collection.py +++ b/tests/unit/models/config/test_user_data_collection.py @@ -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, @@ -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",