1515
1616
1717def test_byok_rag_configuration_default_values () -> None :
18- """Test the ByokRag constructor."""
18+ """Test the ByokRag constructor.
19+
20+ Verify that ByokRag initializes correctly when only required fields are provided.
21+
22+ Asserts that the instance stores the given `rag_id`, `vector_db_id`, and
23+ `db_path`, and that unspecified fields use the module's default values for
24+ `rag_type`, `embedding_model`, `embedding_dimension`, and
25+ `score_multiplier`.
26+ """
1927 byok_rag = ByokRag ( # pyright: ignore[reportCallIssue]
2028 rag_id = "rag_id" ,
2129 vector_db_id = "vector_db_id" ,
@@ -58,7 +66,13 @@ def test_byok_rag_configuration_nondefault_values() -> None:
5866
5967
6068def test_byok_rag_configuration_wrong_dimension () -> None :
61- """Test the ByokRag constructor."""
69+ """Test the ByokRag constructor.
70+
71+ Verify constructing ByokRag with embedding_dimension less than or equal to
72+ zero raises a ValidationError.
73+
74+ The raised ValidationError's message must contain "should be greater than 0".
75+ """
6276 with pytest .raises (ValidationError , match = "should be greater than 0" ):
6377 _ = ByokRag (
6478 rag_id = "rag_id" ,
@@ -71,7 +85,13 @@ def test_byok_rag_configuration_wrong_dimension() -> None:
7185
7286
7387def test_byok_rag_configuration_empty_rag_id () -> None :
74- """Test the ByokRag constructor."""
88+ """Test the ByokRag constructor.
89+
90+ Validate that constructing a ByokRag with an empty `rag_id` raises a validation error.
91+
92+ Expects a `pydantic.ValidationError` whose message contains "String should
93+ have at least 1 character".
94+ """
7595 with pytest .raises (
7696 ValidationError , match = "String should have at least 1 character"
7797 ):
@@ -108,7 +128,13 @@ def test_byok_rag_configuration_empty_rag_type() -> None:
108128
109129
110130def test_byok_rag_configuration_empty_embedding_model () -> None :
111- """Test the ByokRag constructor."""
131+ """Test the ByokRag constructor.
132+
133+ Verify that constructing a ByokRag with an empty `embedding_model` raises a validation error.
134+
135+ Expects a pydantic.ValidationError whose message contains "String should
136+ have at least 1 character".
137+ """
112138 with pytest .raises (
113139 ValidationError , match = "String should have at least 1 character"
114140 ):
@@ -123,7 +149,13 @@ def test_byok_rag_configuration_empty_embedding_model() -> None:
123149
124150
125151def test_byok_rag_configuration_empty_vector_db_id () -> None :
126- """Test the ByokRag constructor."""
152+ """Test the ByokRag constructor.
153+
154+ Ensure constructing a ByokRag with an empty `vector_db_id` raises a ValidationError.
155+
156+ Asserts that Pydantic validation fails with a message containing "String
157+ should have at least 1 character".
158+ """
127159 with pytest .raises (
128160 ValidationError , match = "String should have at least 1 character"
129161 ):
0 commit comments