66
77
88def test_input_special_chars_basemodel () -> None :
9- """Test that codegen handles special characters in input field names for BaseModel."""
10-
11- # Test should pass without raising an exception
9+ """Handles special characters in input field names for BaseModel."""
10+
1211 schema_to_river_client_codegen (
13- read_schema = lambda : open ("tests/v1/codegen/rpc/input-special-chars-schema.json" ),
12+ read_schema = lambda : open (
13+ "tests/v1/codegen/rpc/input-special-chars-schema.json"
14+ ), # noqa: E501
1415 target_path = "tests/v1/codegen/rpc/generated_input_special" ,
1516 client_name = "InputSpecialClient" ,
1617 typed_dict_inputs = False , # BaseModel inputs
@@ -21,11 +22,13 @@ def test_input_special_chars_basemodel() -> None:
2122
2223
2324def test_input_special_chars_typeddict () -> None :
24- """Test that codegen handles special characters in input field names for TypedDict."""
25-
25+ """Handles special characters in input field names for TypedDict."""
26+
2627 # Test should pass without raising an exception
2728 schema_to_river_client_codegen (
28- read_schema = lambda : open ("tests/v1/codegen/rpc/input-special-chars-schema.json" ),
29+ read_schema = lambda : open (
30+ "tests/v1/codegen/rpc/input-special-chars-schema.json"
31+ ), # noqa: E501
2932 target_path = "tests/v1/codegen/rpc/generated_input_special_td" ,
3033 client_name = "InputSpecialTDClient" ,
3134 typed_dict_inputs = True , # TypedDict inputs
@@ -36,11 +39,13 @@ def test_input_special_chars_typeddict() -> None:
3639
3740
3841def test_input_collision_error_basemodel () -> None :
39- """Test that codegen raises ValueError for input field name collisions with BaseModel."""
42+ """Raises ValueError for input field name collisions with BaseModel."""
4043
4144 with pytest .raises (ValueError ) as exc_info :
4245 schema_to_river_client_codegen (
43- read_schema = lambda : open ("tests/v1/codegen/rpc/input-collision-schema.json" ),
46+ read_schema = lambda : open (
47+ "tests/v1/codegen/rpc/input-collision-schema.json"
48+ ), # noqa: E501
4449 target_path = "tests/v1/codegen/rpc/generated_input_collision" ,
4550 client_name = "InputCollisionClient" ,
4651 typed_dict_inputs = False , # BaseModel inputs
@@ -58,11 +63,13 @@ def test_input_collision_error_basemodel() -> None:
5863
5964
6065def test_input_collision_error_typeddict () -> None :
61- """Test that codegen raises ValueError for input field name collisions with TypedDict."""
66+ """Raises ValueError for input field name collisions with TypedDict."""
6267
6368 with pytest .raises (ValueError ) as exc_info :
6469 schema_to_river_client_codegen (
65- read_schema = lambda : open ("tests/v1/codegen/rpc/input-collision-schema.json" ),
70+ read_schema = lambda : open (
71+ "tests/v1/codegen/rpc/input-collision-schema.json"
72+ ), # noqa: E501
6673 target_path = "tests/v1/codegen/rpc/generated_input_collision_td" ,
6774 client_name = "InputCollisionTDClient" ,
6875 typed_dict_inputs = True , # TypedDict inputs
@@ -80,8 +87,8 @@ def test_input_collision_error_typeddict() -> None:
8087
8188
8289def test_init_special_chars_basemodel () -> None :
83- """Test that codegen handles special characters in init field names for BaseModel."""
84-
90+ """Handles special characters in init field names for BaseModel."""
91+
8592 init_schema = {
8693 "services" : {
8794 "test_service" : {
@@ -92,21 +99,21 @@ def test_init_special_chars_basemodel() -> None:
9299 "properties" : {
93100 "init-field1" : {"type" : "string" },
94101 "init:field2" : {"type" : "number" },
95- "init.field3" : {"type" : "boolean" }
102+ "init.field3" : {"type" : "boolean" },
96103 },
97- "required" : ["init-field1" ]
104+ "required" : ["init-field1" ],
98105 },
99106 "output" : {"type" : "boolean" },
100107 "errors" : {"not" : {}},
101- "type" : "stream"
108+ "type" : "stream" ,
102109 }
103110 }
104111 }
105112 }
106113 }
107-
114+
108115 import json
109-
116+
110117 # Test should pass without raising an exception
111118 schema_to_river_client_codegen (
112119 read_schema = lambda : StringIO (json .dumps (init_schema )),
@@ -120,8 +127,8 @@ def test_init_special_chars_basemodel() -> None:
120127
121128
122129def test_init_special_chars_typeddict () -> None :
123- """Test that codegen handles special characters in init field names for TypedDict."""
124-
130+ """Handles special characters in init field names for TypedDict."""
131+
125132 init_schema = {
126133 "services" : {
127134 "test_service" : {
@@ -132,21 +139,21 @@ def test_init_special_chars_typeddict() -> None:
132139 "properties" : {
133140 "init-field1" : {"type" : "string" },
134141 "init:field2" : {"type" : "number" },
135- "init.field3" : {"type" : "boolean" }
142+ "init.field3" : {"type" : "boolean" },
136143 },
137- "required" : ["init-field1" ]
144+ "required" : ["init-field1" ],
138145 },
139146 "output" : {"type" : "boolean" },
140147 "errors" : {"not" : {}},
141- "type" : "stream"
148+ "type" : "stream" ,
142149 }
143150 }
144151 }
145152 }
146153 }
147-
154+
148155 import json
149-
156+
150157 # Test should pass without raising an exception
151158 schema_to_river_client_codegen (
152159 read_schema = lambda : StringIO (json .dumps (init_schema )),
0 commit comments