@@ -460,11 +460,9 @@ def test_delete_flow_not_owned(mock_delete, test_files_directory, test_api_key):
460460 ):
461461 openml .flows .delete_flow (40_000 )
462462
463- expected_call_args = [
464- ("https://test.openml.org/api/v1/xml/flow/40000" ,),
465- {"params" : {"api_key" : test_api_key }},
466- ]
467- assert expected_call_args == list (mock_delete .call_args )
463+ flow_url = "https://test.openml.org/api/v1/xml/flow/40000"
464+ assert flow_url == mock_delete .call_args .args [0 ]
465+ assert test_api_key == mock_delete .call_args .kwargs .get ("params" , {}).get ("api_key" )
468466
469467
470468@mock .patch .object (requests .Session , "delete" )
@@ -482,11 +480,9 @@ def test_delete_flow_with_run(mock_delete, test_files_directory, test_api_key):
482480 ):
483481 openml .flows .delete_flow (40_000 )
484482
485- expected_call_args = [
486- ("https://test.openml.org/api/v1/xml/flow/40000" ,),
487- {"params" : {"api_key" : test_api_key }},
488- ]
489- assert expected_call_args == list (mock_delete .call_args )
483+ flow_url = "https://test.openml.org/api/v1/xml/flow/40000"
484+ assert flow_url == mock_delete .call_args .args [0 ]
485+ assert test_api_key == mock_delete .call_args .kwargs .get ("params" , {}).get ("api_key" )
490486
491487
492488@mock .patch .object (requests .Session , "delete" )
@@ -504,11 +500,9 @@ def test_delete_subflow(mock_delete, test_files_directory, test_api_key):
504500 ):
505501 openml .flows .delete_flow (40_000 )
506502
507- expected_call_args = [
508- ("https://test.openml.org/api/v1/xml/flow/40000" ,),
509- {"params" : {"api_key" : test_api_key }},
510- ]
511- assert expected_call_args == list (mock_delete .call_args )
503+ flow_url = "https://test.openml.org/api/v1/xml/flow/40000"
504+ assert flow_url == mock_delete .call_args .args [0 ]
505+ assert test_api_key == mock_delete .call_args .kwargs .get ("params" , {}).get ("api_key" )
512506
513507
514508@mock .patch .object (requests .Session , "delete" )
@@ -523,11 +517,9 @@ def test_delete_flow_success(mock_delete, test_files_directory, test_api_key):
523517 success = openml .flows .delete_flow (33364 )
524518 assert success
525519
526- expected_call_args = [
527- ("https://test.openml.org/api/v1/xml/flow/33364" ,),
528- {"params" : {"api_key" : test_api_key }},
529- ]
530- assert expected_call_args == list (mock_delete .call_args )
520+ flow_url = "https://test.openml.org/api/v1/xml/flow/33364"
521+ assert flow_url == mock_delete .call_args .args [0 ]
522+ assert test_api_key == mock_delete .call_args .kwargs .get ("params" , {}).get ("api_key" )
531523
532524
533525@mock .patch .object (requests .Session , "delete" )
@@ -545,8 +537,6 @@ def test_delete_unknown_flow(mock_delete, test_files_directory, test_api_key):
545537 ):
546538 openml .flows .delete_flow (9_999_999 )
547539
548- expected_call_args = [
549- ("https://test.openml.org/api/v1/xml/flow/9999999" ,),
550- {"params" : {"api_key" : test_api_key }},
551- ]
552- assert expected_call_args == list (mock_delete .call_args )
540+ flow_url = "https://test.openml.org/api/v1/xml/flow/9999999"
541+ assert flow_url == mock_delete .call_args .args [0 ]
542+ assert test_api_key == mock_delete .call_args .kwargs .get ("params" , {}).get ("api_key" )
0 commit comments