Skip to content

Commit ad05cd3

Browse files
committed
remove old delete methods
Signed-off-by: Omswastik-11 <omswastikpanda11@gmail.com>
1 parent b349581 commit ad05cd3

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

tests/test_runs/test_run_functions.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ def test_initialize_model_from_run_nonstrict(self):
18071807
# This tests all lines of code for OpenML but not the initialization, which we do not want to guarantee anyhow.
18081808
_ = openml.runs.initialize_model_from_run(run_id=1, strict_version=False)
18091809

1810-
@mock.patch.object(requests.Session, "delete")
1810+
@mock.patch.object(requests.Session, "request")
18111811
def test_delete_run_not_owned(mock_delete, test_files_directory, test_api_key):
18121812
openml.config.start_using_configuration_for_example()
18131813
content_file = test_files_directory / "mock_responses" / "runs" / "run_delete_not_owned.xml"
@@ -1823,10 +1823,13 @@ def test_delete_run_not_owned(mock_delete, test_files_directory, test_api_key):
18231823
openml.runs.delete_run(40_000)
18241824

18251825
run_url = "https://test.openml.org/api/v1/xml/run/40000"
1826-
assert run_url == mock_delete.call_args.args[0]
1826+
print(mock_delete.call_args.kwargs)
1827+
assert run_url == mock_delete.call_args.kwargs.get("url")
1828+
assert "DELETE" == mock_delete.call_args.kwargs.get("method")
18271829
assert test_api_key == mock_delete.call_args.kwargs.get("params", {}).get("api_key")
18281830

1829-
@mock.patch.object(requests.Session, "delete")
1831+
1832+
@mock.patch.object(requests.Session, "request")
18301833
def test_delete_run_success(mock_delete, test_files_directory, test_api_key):
18311834
openml.config.start_using_configuration_for_example()
18321835
content_file = test_files_directory / "mock_responses" / "runs" / "run_delete_successful.xml"
@@ -1839,10 +1842,13 @@ def test_delete_run_success(mock_delete, test_files_directory, test_api_key):
18391842
assert success
18401843

18411844
run_url = "https://test.openml.org/api/v1/xml/run/10591880"
1842-
assert run_url == mock_delete.call_args.args[0]
1845+
print(mock_delete.call_args.kwargs)
1846+
assert run_url == mock_delete.call_args.kwargs.get("url")
1847+
assert "DELETE" == mock_delete.call_args.kwargs.get("method")
18431848
assert test_api_key == mock_delete.call_args.kwargs.get("params", {}).get("api_key")
18441849

1845-
@mock.patch.object(requests.Session, "delete")
1850+
1851+
@mock.patch.object(requests.Session, "request")
18461852
def test_delete_unknown_run(mock_delete, test_files_directory, test_api_key):
18471853
openml.config.start_using_configuration_for_example()
18481854
content_file = test_files_directory / "mock_responses" / "runs" / "run_delete_not_exist.xml"
@@ -1858,7 +1864,9 @@ def test_delete_unknown_run(mock_delete, test_files_directory, test_api_key):
18581864
openml.runs.delete_run(9_999_999)
18591865

18601866
run_url = "https://test.openml.org/api/v1/xml/run/9999999"
1861-
assert run_url == mock_delete.call_args.args[0]
1867+
print(mock_delete.call_args.kwargs)
1868+
assert run_url == mock_delete.call_args.kwargs.get("url")
1869+
assert "DELETE" == mock_delete.call_args.kwargs.get("method")
18621870
assert test_api_key == mock_delete.call_args.kwargs.get("params", {}).get("api_key")
18631871

18641872

0 commit comments

Comments
 (0)