From 93f4a2b6c7f8c895a95a0e40b97b87a64dbe27be Mon Sep 17 00:00:00 2001 From: iwatkot Date: Thu, 20 Jun 2024 03:18:48 +0200 Subject: [PATCH] Get client ips fix. --- py3xui/api/api_client.py | 4 +--- tests/test_api.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/py3xui/api/api_client.py b/py3xui/api/api_client.py index f19dcff..26c6725 100644 --- a/py3xui/api/api_client.py +++ b/py3xui/api/api_client.py @@ -292,9 +292,7 @@ def delete_depleted(self, inbound_id: int) -> None: api.client.delete_depleted(inbound.id) ``` """ # pylint: disable=line-too-long - endpoint = "panel/api/inbounds/delDepletedClients/0" - if inbound_id: - endpoint += f"{inbound_id}" + endpoint = f"panel/api/inbounds/delDepletedClients/{inbound_id}" headers = {"Accept": "application/json"} url = self._url(endpoint) diff --git a/tests/test_api.py b/tests/test_api.py index a78d4e4..3370c48 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -89,7 +89,7 @@ def test_get_client_ips(): api = Api(HOST, USERNAME, PASSWORD, skip_login=True) ips = api.client.get_ips(EMAIL) - assert ips is None, f"Expected None, got {ips}" + assert ips == [], f"Expected None, got {ips}" def _prepare_inbound() -> Inbound: