Skip to content
Snippets Groups Projects
Commit ae654de0 authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

api.RPCClient: replace use of deprecated post method in generated methods

This avoids spamming a deprecation error clients can't do anything about.
parent 83fb36b8
No related branches found
No related tags found
No related merge requests found
......@@ -179,7 +179,7 @@ class MetaRPCClient(type):
post_data.pop("db", None)
# Send the request.
return self.post(meth._endpoint_path, post_data)
return self._post(meth._endpoint_path, post_data)
if meth_name not in attributes:
attributes[meth_name] = meth_
......
......@@ -104,7 +104,7 @@ def test_client_connexion_error(rpc_client, requests_mock):
)
with pytest.raises(APIError) as exc_info:
rpc_client.post("connection_error", data={})
rpc_client._post("connection_error", data={})
assert type(exc_info.value.args[0]) == ConnectionError
assert str(exc_info.value.args[0]) == error_message
......@@ -142,7 +142,7 @@ def test_client_reraise_exception(rpc_client, requests_mock, old_exception_schem
)
with pytest.raises(ReraiseException) as exc_info:
rpc_client.post(endpoint, data={})
rpc_client._post(endpoint, data={})
assert str(exc_info.value) == error_message
......@@ -171,7 +171,7 @@ def test_client_raise_remote_exception(
)
with pytest.raises(RemoteException) as exc_info:
rpc_client.post(endpoint, data={})
rpc_client._post(endpoint, data={})
assert str(exc_info.value.args[0]["type"]) == "Exception"
assert str(exc_info.value.args[0]["message"]) == error_message
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment