diff --git a/swh/icinga_plugins/deposit.py b/swh/icinga_plugins/deposit.py --- a/swh/icinga_plugins/deposit.py +++ b/swh/icinga_plugins/deposit.py @@ -175,9 +175,11 @@ # Get metadata list from swh-web metadata_objects = requests.get( - f"{self.api_url}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20{self._provider_url}" - f"&after={start_datetime.isoformat()}" + f"{self.api_url}/api/1/raw-extrinsic-metadata/swhid/{swhid}/", + params={ + "authority": f"deposit_client {self._provider_url}", + "after": start_datetime.isoformat(), + }, ).json() expected_origin = f"{self._provider_url}/{self._slug}" diff --git a/swh/icinga_plugins/tests/test_deposit.py b/swh/icinga_plugins/tests/test_deposit.py --- a/swh/icinga_plugins/tests/test_deposit.py +++ b/swh/icinga_plugins/tests/test_deposit.py @@ -19,7 +19,7 @@ POLL_INTERVAL = 10 BASE_URL = "http://swh-deposit.example.org/1" -BASE_WEB_URL = "mock://swh-web.example.org" +BASE_WEB_URL = "http+mock://swh-web.example.org" PROVIDER_URL = "http://icinga-checker.example.org" COMMON_OPTIONS = [ @@ -213,8 +213,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", [ { "swhid": swhid, @@ -296,8 +296,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", [ { "swhid": swhid, @@ -377,8 +377,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", [ { "swhid": swhid, @@ -453,8 +453,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", [ { "swhid": swhid, @@ -520,8 +520,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", [ { "swhid": swhid, @@ -642,8 +642,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", metadata_list, ) @@ -705,8 +705,8 @@ scenario.add_step( "get", f"{BASE_WEB_URL}/api/1/raw-extrinsic-metadata/swhid/{swhid}/" - f"?authority=deposit_client%20http://icinga-checker.example.org" - f"&after=2022-03-04T17:02:39+00:00", + f"?authority=deposit_client+http%3A%2F%2Ficinga-checker.example.org" + f"&after=2022-03-04T17%3A02%3A39%2B00%3A00", metadata_list, ) scenario.add_step(