From c3634610558a407063fe972498a6dbe1c1d66513 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Thu, 19 Sep 2024 18:07:19 +0200 Subject: [PATCH] cast legacy verify to bool (#77) --- cads_api_client/legacy_api_client.py | 7 +++---- tests/integration_test_50_legacy_api_client.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cads_api_client/legacy_api_client.py b/cads_api_client/legacy_api_client.py index fcc38e6..889dd8c 100644 --- a/cads_api_client/legacy_api_client.py +++ b/cads_api_client/legacy_api_client.py @@ -70,7 +70,7 @@ def __init__( key: str | None = None, quiet: bool = False, debug: bool = False, - verify: bool | None = None, + verify: bool | int | None = None, timeout: int = 60, progress: bool = True, *args: Any, @@ -80,9 +80,8 @@ def __init__( if wrong_kwargs := set(kwargs) - set(LEGACY_KWARGS): raise ValueError(f"Wrong parameters: {wrong_kwargs}.") - self.url, self.key, self.verify = cdsapi.api.get_url_key_verify( - url, key, verify - ) + self.url, self.key, verify = cdsapi.api.get_url_key_verify(url, key, verify) + self.verify = bool(verify) self.quiet = quiet self._debug = debug self.timeout = timeout diff --git a/tests/integration_test_50_legacy_api_client.py b/tests/integration_test_50_legacy_api_client.py index 1db3e11..6c78a35 100644 --- a/tests/integration_test_50_legacy_api_client.py +++ b/tests/integration_test_50_legacy_api_client.py @@ -157,7 +157,7 @@ def test_legacy_api_client_kwargs(api_root_url: str, api_anon_key: str) -> None: client = legacy_api_client.LegacyApiClient( url=api_root_url, key=api_anon_key, - verify=False, + verify=0, timeout=1, progress=False, delete=True,