@@ -199,12 +199,23 @@ def test_raise_retrieve_unknown(self, cognite_client: CogniteClient) -> None:
199199 cognite_client .functions .schedules .retrieve (id = [123 ])
200200 assert cognite_client .functions .schedules .retrieve (id = 123 ) is None
201201
202- def test_create_with_nonce (self , cognite_client : CogniteClient , dummy_function : Function ) -> None :
202+ def test_create_with_nonce (self , cognite_client : CogniteClient ) -> None :
203203 session = cognite_client .iam .sessions .create (session_type = "ONESHOT_TOKEN_EXCHANGE" )
204+
205+ def handle (client , data , secrets , function_call_info ):
206+ print (f"Inputs: { data !r} " ) # noqa
207+ print (f"Call info: { function_call_info !r} " ) # noqa
208+ return data
209+
210+ created_fn = cognite_client .functions .create (
211+ name = "test_function_for_schedule_with_nonce" ,
212+ function_handle = handle ,
213+ description = "print inputs & call info, return inputs" ,
214+ )
204215 schedule = FunctionScheduleWrite (
205216 name = "test_create_with_nonce" ,
206217 cron_expression = "0 0 * * *" ,
207- function_id = dummy_function .id ,
218+ function_id = created_fn .id ,
208219 data = {"key" : "value" },
209220 nonce = session .nonce ,
210221 )
@@ -220,3 +231,5 @@ def test_create_with_nonce(self, cognite_client: CogniteClient, dummy_function:
220231 finally :
221232 if created :
222233 cognite_client .functions .schedules .delete (created .id )
234+ if created_fn :
235+ cognite_client .functions .delete (id = created_fn .id )
0 commit comments