@@ -22,8 +22,8 @@ def test_process_bind_param_with_pydantic_model(self):
2222 dialect = MagicMock ()
2323
2424 result = pydantic_type .process_bind_param (status , dialect )
25- assert result [" state" ] == " working"
26- assert result [" message" ] is None
25+ assert result [' state' ] == ' working'
26+ assert result [' message' ] is None
2727 # TaskStatus may have other optional fields
2828
2929 def test_process_bind_param_with_none (self ):
@@ -37,9 +37,11 @@ def test_process_result_value(self):
3737 pydantic_type = PydanticType (TaskStatus )
3838 dialect = MagicMock ()
3939
40- result = pydantic_type .process_result_value ({"state" : "completed" , "message" : None }, dialect )
40+ result = pydantic_type .process_result_value (
41+ {'state' : 'completed' , 'message' : None }, dialect
42+ )
4143 assert isinstance (result , TaskStatus )
42- assert result .state == " completed"
44+ assert result .state == ' completed'
4345
4446
4547class TestPydanticListType :
@@ -48,33 +50,38 @@ class TestPydanticListType:
4850 def test_process_bind_param_with_list (self ):
4951 pydantic_list_type = PydanticListType (Artifact )
5052 artifacts = [
51- Artifact (artifact_id = "1" , parts = [TextPart (type = "text" , text = "Hello" )]),
52- Artifact (artifact_id = "2" , parts = [TextPart (type = "text" , text = "World" )])
53+ Artifact (
54+ artifact_id = '1' , parts = [TextPart (type = 'text' , text = 'Hello' )]
55+ ),
56+ Artifact (
57+ artifact_id = '2' , parts = [TextPart (type = 'text' , text = 'World' )]
58+ ),
5359 ]
5460 dialect = MagicMock ()
5561
5662 result = pydantic_list_type .process_bind_param (artifacts , dialect )
5763 assert len (result ) == 2
58- assert result [0 ][" artifactId" ] == "1" # JSON mode uses camelCase
59- assert result [1 ][" artifactId" ] == "2"
64+ assert result [0 ][' artifactId' ] == '1' # JSON mode uses camelCase
65+ assert result [1 ][' artifactId' ] == '2'
6066
6167 def test_process_result_value_with_list (self ):
6268 pydantic_list_type = PydanticListType (Artifact )
6369 dialect = MagicMock ()
6470 data = [
65- {" artifact_id" : "1" , " parts" : [{" type" : " text" , " text" : " Hello" }]},
66- {" artifact_id" : "2" , " parts" : [{" type" : " text" , " text" : " World" }]}
71+ {' artifact_id' : '1' , ' parts' : [{' type' : ' text' , ' text' : ' Hello' }]},
72+ {' artifact_id' : '2' , ' parts' : [{' type' : ' text' , ' text' : ' World' }]},
6773 ]
6874
6975 result = pydantic_list_type .process_result_value (data , dialect )
7076 assert len (result ) == 2
7177 assert all (isinstance (art , Artifact ) for art in result )
72- assert result [0 ].artifact_id == "1"
73- assert result [1 ].artifact_id == "2"
78+ assert result [0 ].artifact_id == '1'
79+ assert result [1 ].artifact_id == '2'
7480
7581
7682def test_create_task_model ():
7783 """Test dynamic task model creation."""
84+
7885 # Create a fresh base to avoid table conflicts
7986 class TestBase (DeclarativeBase ):
8087 pass
@@ -92,15 +99,20 @@ class TestBase(DeclarativeBase):
9299
93100def test_create_push_notification_config_model ():
94101 """Test dynamic push notification config model creation."""
102+
95103 # Create a fresh base to avoid table conflicts
96104 class TestBase (DeclarativeBase ):
97105 pass
98106
99107 # Create with default table name
100- default_model = create_push_notification_config_model ('test_push_configs_1' , TestBase )
108+ default_model = create_push_notification_config_model (
109+ 'test_push_configs_1' , TestBase
110+ )
101111 assert default_model .__tablename__ == 'test_push_configs_1'
102112
103113 # Create with custom table name
104- custom_model = create_push_notification_config_model ('test_push_configs_2' , TestBase )
114+ custom_model = create_push_notification_config_model (
115+ 'test_push_configs_2' , TestBase
116+ )
105117 assert custom_model .__tablename__ == 'test_push_configs_2'
106118 assert 'test_push_configs_2' in custom_model .__name__
0 commit comments