diff --git a/src/stringx/client.py b/src/stringx/client.py index 620f445..0bc5c3e 100644 --- a/src/stringx/client.py +++ b/src/stringx/client.py @@ -90,10 +90,7 @@ def interaction_partners( return self.request("interaction_partners", params=params) - def version(self): - print(self.params) - self.params = {} - request = self.build_request("GET", "https://api.example.com") - del request.headers["X-Api-Key"] - - return self.request("version", params={}) + def version(self) -> str: + request = self.build_request("GET", "api/json/version") + request.url = request.url.copy_remove_param("caller_identity") + return self.send(request).json() diff --git a/tests/test_client.py b/tests/test_client.py index 0e5efeb..9b66756 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -119,12 +119,14 @@ def test_interaction_partners(httpx_mock): def test_version(httpx_mock): httpx_mock.add_response( - url=httpx.URL("https://string-db.org/api/json/version"), method="POST", json={} + url=httpx.URL("https://string-db.org/api/json/version"), + method="GET", + json=[ + { + "string_version": "12.0", + "stable_address": "https://version-12-0.string-db.org", + } + ], ) with stringx.Client() as client: - version = client.version() - version = client.map(["edin"], species=7227) - version = client.version() - - print(version) - assert version == "" + client.version()