1616# Tests for data models.
1717
1818import json
19+ import unittest
1920
2021from dapr .ext .crewai .models import (
2122 AgentConfig ,
3233)
3334
3435
35- class TestToolCall :
36+ class TestToolCall ( unittest . TestCase ) :
3637 def test_to_dict (self ):
3738 tc = ToolCall (id = 'call_123' , name = 'search' , args = {'query' : 'test' })
3839 result = tc .to_dict ()
@@ -57,7 +58,7 @@ def test_roundtrip(self):
5758 assert original .args == roundtripped .args
5859
5960
60- class TestToolResult :
61+ class TestToolResult ( unittest . TestCase ) :
6162 def test_to_dict (self ):
6263 tr = ToolResult (
6364 tool_call_id = 'call_123' ,
@@ -82,7 +83,7 @@ def test_from_dict_with_error(self):
8283 assert tr .result is None
8384
8485
85- class TestMessage :
86+ class TestMessage ( unittest . TestCase ) :
8687 def test_user_message (self ):
8788 msg = Message (role = MessageRole .USER , content = 'Hello' )
8889 data = msg .to_dict ()
@@ -127,7 +128,7 @@ def test_roundtrip(self):
127128 assert len (original .tool_calls ) == len (roundtripped .tool_calls )
128129
129130
130- class TestAgentConfig :
131+ class TestAgentConfig ( unittest . TestCase ) :
131132 def test_to_dict (self ):
132133 config = AgentConfig (
133134 role = 'Research Assistant' ,
@@ -159,7 +160,7 @@ def test_from_dict(self):
159160 assert config .verbose is True
160161
161162
162- class TestAgentWorkflowInput :
163+ class TestAgentWorkflowInput ( unittest . TestCase ) :
163164 def test_json_serializable (self ):
164165 """Test that the entire input can be JSON serialized."""
165166 agent_config = AgentConfig (
@@ -189,7 +190,7 @@ def test_json_serializable(self):
189190 assert parsed .agent_config .role == 'Assistant'
190191
191192
192- class TestAgentWorkflowOutput :
193+ class TestAgentWorkflowOutput ( unittest . TestCase ) :
193194 def test_completed_output (self ):
194195 output = AgentWorkflowOutput (
195196 final_response = 'The answer is 42' ,
@@ -214,7 +215,7 @@ def test_error_output(self):
214215 assert data ['error' ] == 'Something went wrong'
215216
216217
217- class TestCallLlmInput :
218+ class TestCallLlmInput ( unittest . TestCase ) :
218219 def test_to_dict (self ):
219220 agent_config = AgentConfig (
220221 role = 'Assistant' ,
@@ -237,7 +238,7 @@ def test_to_dict(self):
237238 assert 'messages' in data
238239
239240
240- class TestExecuteToolInput :
241+ class TestExecuteToolInput ( unittest . TestCase ) :
241242 def test_to_dict (self ):
242243 tc = ToolCall (id = 'call_123' , name = 'search' , args = {'query' : 'test' })
243244 tool_input = ExecuteToolInput (
0 commit comments