@@ -61,7 +61,14 @@ def test_different_resource_types(self) -> None:
6161 )
6262
6363 def test_openapi_response (self ) -> None :
64- """Test BadRequestResponse.openapi_response() method."""
64+ """Test BadRequestResponse.openapi_response() method.
65+
66+ Verify that BadRequestResponse.openapi_response() produces an OpenAPI
67+ entry with the correct description, model reference, and JSON examples,
68+ and that the examples list matches the model schema's examples and
69+ contains a `conversation_id` example whose detail.response equals
70+ "Invalid conversation ID format".
71+ """
6572 schema = BadRequestResponse .model_json_schema ()
6673 model_examples = schema .get ("examples" , [])
6774 expected_count = len (model_examples )
@@ -86,7 +93,16 @@ def test_openapi_response(self) -> None:
8693 )
8794
8895 def test_openapi_response_with_explicit_examples (self ) -> None :
89- """Test BadRequestResponse.openapi_response() with explicit examples."""
96+ """Test BadRequestResponse.openapi_response() with explicit examples.
97+
98+ Verify BadRequestResponse.openapi_response returns only the specified
99+ example when explicit example labels are provided.
100+
101+ Asserts that calling
102+ BadRequestResponse.openapi_response(examples=["conversation_id"])
103+ produces application/json examples containing exactly one entry with
104+ the key "conversation_id".
105+ """
90106 result = BadRequestResponse .openapi_response (examples = ["conversation_id" ])
91107 examples = result ["content" ]["application/json" ]["examples" ]
92108
@@ -204,7 +220,11 @@ def test_factory_endpoint(self) -> None:
204220 )
205221
206222 def test_factory_feedback_disabled (self ) -> None :
207- """Test ForbiddenResponse.feedback_disabled() factory method."""
223+ """Test ForbiddenResponse.feedback_disabled() factory method.
224+
225+ Verifies that ForbiddenResponse.feedback_disabled() produces a 403
226+ AbstractErrorResponse with the expected detail message and cause.
227+ """
208228 response = ForbiddenResponse .feedback_disabled ()
209229 assert isinstance (response , AbstractErrorResponse )
210230 assert response .status_code == status .HTTP_403_FORBIDDEN
0 commit comments