File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ """Unit tests for FeedbackStatusUpdateRequest model."""
2+
3+
4+ from models .requests import FeedbackStatusUpdateRequest
5+
6+
7+ class TestFeedbackStatusUpdateRequest :
8+ """Test cases for the FeedbackStatusUpdateRequest model."""
9+
10+ def test_constructor (self ) -> None :
11+ """Test the FeedbackStatusUpdateRequest constructor."""
12+ fs = FeedbackStatusUpdateRequest (status = False )
13+ assert fs .status is False
14+
15+ fs = FeedbackStatusUpdateRequest (status = True )
16+ assert fs .status is True
17+
18+ def test_get_value (self ) -> None :
19+ """Test the FeedbackStatusUpdateRequest.get_value method."""
20+ fs = FeedbackStatusUpdateRequest (status = False )
21+ assert fs .get_value () is False
22+
23+ fs = FeedbackStatusUpdateRequest (status = True )
24+ assert fs .get_value () is True
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ def test_constructor(self) -> None:
2222 assert qr .system_prompt is None
2323 assert qr .attachments is None
2424
25+ def test_constructor_wrong_conversation_id (self ) -> None :
26+ """Test the QueryRequest constructor with wrong conversation_id."""
27+ with pytest .raises (ValueError , match = "Improper conversation ID 'xyzzy'" ):
28+ _ = QueryRequest (query = "Tell me about Kubernetes" , conversation_id = "xyzzy" )
29+
2530 def test_with_attachments (self ) -> None :
2631 """Test the QueryRequest with attachments."""
2732 attachments = [
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ def test_constructor(self) -> None:
2323
2424 def test_constructor_fields_required (self ) -> None :
2525 """Test the AuthorizedResponse constructor."""
26+ with pytest .raises (ValidationError ):
27+ # missing all parameters
28+ _ = AuthorizedResponse () # pyright: ignore
2629
2730 with pytest .raises (ValidationError ):
2831 # missing user_id parameter
You can’t perform that action at this time.
0 commit comments