@@ -57,7 +57,8 @@ def test_count_function_attach_and_detach(basic_http_client: System) -> None:
5757 assert result ["metadatas" ][0 ]["total_count" ] == 300
5858
5959 # Remove the task
60- success = attached_fn .detach (
60+ success = collection .detach_function (
61+ attached_fn .name ,
6162 delete_output_collection = True ,
6263 )
6364
@@ -108,7 +109,7 @@ def test_attach_function_returns_function_name(basic_http_client: System) -> Non
108109 assert retrieved_fn == attached_fn
109110
110111 # Clean up
111- attached_fn . detach ( delete_output_collection = True )
112+ collection . detach_function ( attached_fn . name , delete_output_collection = True )
112113
113114
114115def test_function_multiple_collections (basic_http_client : System ) -> None :
@@ -146,8 +147,14 @@ def test_function_multiple_collections(basic_http_client: System) -> None:
146147 assert attached_fn1 .id != attached_fn2 .id
147148
148149 # Clean up
149- assert attached_fn1 .detach (delete_output_collection = True ) is True
150- assert attached_fn2 .detach (delete_output_collection = True ) is True
150+ assert (
151+ collection1 .detach_function (attached_fn1 .name , delete_output_collection = True )
152+ is True
153+ )
154+ assert (
155+ collection2 .detach_function (attached_fn2 .name , delete_output_collection = True )
156+ is True
157+ )
151158
152159
153160def test_functions_one_attached_function_per_collection (
@@ -191,7 +198,10 @@ def test_functions_one_attached_function_per_collection(
191198 )
192199
193200 # Detach the first function
194- assert attached_fn1 .detach (delete_output_collection = True ) is True
201+ assert (
202+ collection .detach_function (attached_fn1 .name , delete_output_collection = True )
203+ is True
204+ )
195205
196206 # Now we should be able to attach a new function
197207 attached_fn2 = collection .attach_function (
@@ -205,7 +215,10 @@ def test_functions_one_attached_function_per_collection(
205215 assert attached_fn2 .id != attached_fn1 .id
206216
207217 # Clean up
208- assert attached_fn2 .detach (delete_output_collection = True ) is True
218+ assert (
219+ collection .detach_function (attached_fn2 .name , delete_output_collection = True )
220+ is True
221+ )
209222
210223
211224def test_function_remove_nonexistent (basic_http_client : System ) -> None :
@@ -222,8 +235,8 @@ def test_function_remove_nonexistent(basic_http_client: System) -> None:
222235 params = None ,
223236 )
224237
225- attached_fn . detach ( delete_output_collection = True )
238+ collection . detach_function ( attached_fn . name , delete_output_collection = True )
226239
227240 # Trying to detach this function again should raise NotFoundError
228241 with pytest .raises (NotFoundError , match = "does not exist" ):
229- attached_fn . detach ( delete_output_collection = True )
242+ collection . detach_function ( attached_fn . name , delete_output_collection = True )
0 commit comments