File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ """Unit tests for FeedbackStatusUpdateRequest model."""
2+
3+ from models .requests import FeedbackStatusUpdateRequest
4+
5+
6+ class TestFeedbackStatusUpdateRequest :
7+ """Test cases for the FeedbackStatusUpdateRequest model."""
8+
9+ def test_constructor (self ) -> None :
10+ """Test the FeedbackStatusUpdateRequest constructor."""
11+ fs = FeedbackStatusUpdateRequest (status = False )
12+ assert fs .status is False
13+
14+ fs = FeedbackStatusUpdateRequest (status = True )
15+ assert fs .status is True
16+
17+ def test_get_value (self ) -> None :
18+ """Test the FeedbackStatusUpdateRequest.get_value method."""
19+ fs = FeedbackStatusUpdateRequest (status = False )
20+ assert fs .get_value () is False
21+
22+ fs = FeedbackStatusUpdateRequest (status = True )
23+ 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