88from taskbadger .cli_main import app
99from taskbadger .internal .models import (
1010 PatchedTaskRequest ,
11- PatchedTaskRequestData ,
11+ PatchedTaskRequestDataType0 ,
1212 StatusEnum ,
1313 TaskRequest ,
1414)
@@ -49,13 +49,13 @@ def _should_update_task(last_update, update_frequency_seconds):
4949def test_cli_capture_output ():
5050 update_patch = _test_cli_run (["echo test" ], 0 , args = ["task_name" , "--capture-output" ], update_call_count = 2 )
5151
52- body = PatchedTaskRequest (status = UNSET , data = PatchedTaskRequestData .from_dict ({"stdout" : "test\n " }))
52+ body = PatchedTaskRequest (status = UNSET , data = PatchedTaskRequestDataType0 .from_dict ({"stdout" : "test\n " }))
5353 update_patch .assert_any_call (
5454 client = mock .ANY ,
5555 organization_slug = "org" ,
5656 project_slug = "project" ,
5757 id = mock .ANY ,
58- json_body = body ,
58+ body = body ,
5959 )
6060
6161
@@ -71,13 +71,13 @@ def _should_update_task(last_update, update_frequency_seconds):
7171 update_call_count = 3 ,
7272 )
7373
74- body = PatchedTaskRequest (status = UNSET , data = PatchedTaskRequestData .from_dict ({"stdout" : "test\n 123\n " }))
74+ body = PatchedTaskRequest (status = UNSET , data = PatchedTaskRequestDataType0 .from_dict ({"stdout" : "test\n 123\n " }))
7575 update_patch .assert_any_call (
7676 client = mock .ANY ,
7777 organization_slug = "org" ,
7878 project_slug = "project" ,
7979 id = mock .ANY ,
80- json_body = body ,
80+ body = body ,
8181 )
8282
8383
@@ -115,7 +115,7 @@ def _update(*args, **kwargs):
115115 update_mock (* args , ** kwargs )
116116
117117 # handle updating task data
118- data = kwargs ["json_body " ].data
118+ data = kwargs ["body " ].data
119119 task_return = task_for_test (id = task_id , data = data .additional_properties if data else None )
120120 return Response (HTTPStatus .OK , b"" , {}, task_return )
121121
@@ -138,15 +138,15 @@ def _update(*args, **kwargs):
138138 client = mock .ANY ,
139139 organization_slug = "org" ,
140140 project_slug = "project" ,
141- json_body = request ,
141+ body = request ,
142142 )
143143
144144 if return_code == 0 :
145145 body = PatchedTaskRequest (status = StatusEnum .SUCCESS , value = 100 )
146146 else :
147147 body = PatchedTaskRequest (
148148 status = StatusEnum .ERROR ,
149- data = PatchedTaskRequestData .from_dict ({"return_code" : return_code }),
149+ data = PatchedTaskRequestDataType0 .from_dict ({"return_code" : return_code }),
150150 )
151151
152152 assert update_mock .call_count == update_call_count
@@ -155,7 +155,7 @@ def _update(*args, **kwargs):
155155 organization_slug = "org" ,
156156 project_slug = "project" ,
157157 id = task .id ,
158- json_body = body ,
158+ body = body ,
159159 )
160160 return update_mock
161161
0 commit comments