File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -158,3 +158,31 @@ def test_edit_text_file_contents_request():
158
158
# Test validation error - missing required field
159
159
with pytest .raises (ValidationError ):
160
160
EditTextFileContentsRequest ()
161
+
162
+
163
+ def test_edit_result_to_dict ():
164
+ """Test EditResult's to_dict method."""
165
+ # Test successful result
166
+ result = EditResult (result = "ok" , hash = "newhash123" )
167
+ result_dict = result .to_dict ()
168
+ assert result_dict == {
169
+ "result" : "ok" ,
170
+ "hash" : "newhash123" ,
171
+ "reason" : None ,
172
+ "content" : None ,
173
+ }
174
+
175
+ # Test error result
176
+ result = EditResult (
177
+ result = "error" ,
178
+ reason = "hash mismatch" ,
179
+ hash = "currenthash123" ,
180
+ content = "current content" ,
181
+ )
182
+ result_dict = result .to_dict ()
183
+ assert result_dict == {
184
+ "result" : "error" ,
185
+ "reason" : "hash mismatch" ,
186
+ "hash" : "currenthash123" ,
187
+ "content" : "current content" ,
188
+ }
You can’t perform that action at this time.
0 commit comments