From f2f6f6df70e9c61a612108d42d5a928317964561 Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Mon, 11 Dec 2023 15:43:28 +0200 Subject: [PATCH] fix: correct url for update requests in remote-call trigger --- src/ahriman/core/report/remote_call.py | 4 ++-- tests/ahriman/core/report/test_remote_call.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ahriman/core/report/remote_call.py b/src/ahriman/core/report/remote_call.py index 40c9f577..9e6da67a 100644 --- a/src/ahriman/core/report/remote_call.py +++ b/src/ahriman/core/report/remote_call.py @@ -81,7 +81,7 @@ class RemoteCall(Report): bool: True in case if remote process is alive and False otherwise """ try: - response = self.client.make_request("GET", f"/api/v1/service/process/{process_id}") + response = self.client.make_request("GET", f"{self.client.address}/api/v1/service/process/{process_id}") except requests.HTTPError as ex: status_code = ex.response.status_code if ex.response is not None else None if status_code == 404: @@ -100,7 +100,7 @@ class RemoteCall(Report): Returns: str: remote process id """ - response = self.client.make_request("POST", "/api/v1/service/update", + response = self.client.make_request("POST", f"{self.client.address}/api/v1/service/update", params=self.repository_id.query(), json={ "aur": self.update_aur, diff --git a/tests/ahriman/core/report/test_remote_call.py b/tests/ahriman/core/report/test_remote_call.py index 73e30351..a6b34ccd 100644 --- a/tests/ahriman/core/report/test_remote_call.py +++ b/tests/ahriman/core/report/test_remote_call.py @@ -30,7 +30,7 @@ def test_is_process_alive(remote_call: RemoteCall, mocker: MockerFixture) -> Non request_mock = mocker.patch("ahriman.core.status.web_client.WebClient.make_request", return_value=response_obj) assert remote_call.is_process_alive("id") - request_mock.assert_called_once_with("GET", "/api/v1/service/process/id") + request_mock.assert_called_once_with("GET", f"{remote_call.client.address}/api/v1/service/process/id") def test_is_process_alive_unknown(remote_call: RemoteCall, mocker: MockerFixture) -> None: @@ -79,7 +79,7 @@ def test_remote_update(remote_call: RemoteCall, mocker: MockerFixture) -> None: request_mock = mocker.patch("ahriman.core.status.web_client.WebClient.make_request", return_value=response_obj) assert remote_call.remote_update() == "id" - request_mock.assert_called_once_with("POST", "/api/v1/service/update", + request_mock.assert_called_once_with("POST", f"{remote_call.client.address}/api/v1/service/update", params=remote_call.repository_id.query(), json={ "aur": False,