From 7fb50826bcf721d638ae8fb59fc29b1161dba3bc Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Thu, 16 Jan 2025 16:57:59 +0100 Subject: [PATCH] Revert "Minor tweaks to aid in local integration testing" This reverts commit 44c884e8fbf955c531cdb4f820c732f100decf67. --- gcapi/client.py | 7 ++----- tests/conftest.py | 6 +----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/gcapi/client.py b/gcapi/client.py index bcd13e0..528d2d1 100644 --- a/gcapi/client.py +++ b/gcapi/client.py @@ -418,7 +418,7 @@ def __init__( self._auth_header = _generate_auth_header(token=token) self.base_url = URL(base_url) - if verify and self.base_url.scheme.lower() != "https": + if self.base_url.scheme.lower() != "https": raise RuntimeError("Base URL must be https") self._api_meta = ApiDefinitions() @@ -439,10 +439,7 @@ def __getattr__(self, item): def validate_url(self, url): url = URL(url) - if ( - url.scheme.lower() != self.base_url.scheme.lower() - or url.netloc != self.base_url.netloc - ): + if not url.scheme == "https" or url.netloc != self.base_url.netloc: raise RuntimeError(f"Invalid target URL: {url}") def __call__( diff --git a/tests/conftest.py b/tests/conftest.py index c312beb..c848bb5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,10 +26,7 @@ def anyio_backend(): @pytest.fixture(scope="session") def local_grand_challenge() -> Generator[str, None, None]: - local_api_url = os.environ.get( - "LOCAL_API_URL", - "https://gc.localhost/api/v1/", - ) + local_api_url = "https://gc.localhost/api/v1/" try: r = httpx.get( @@ -37,7 +34,6 @@ def local_grand_challenge() -> Generator[str, None, None]: verify=False, headers={"Authorization": f"Bearer {ADMIN_TOKEN}"}, ) - r.raise_for_status() local_gc_running = True except httpx.HTTPError: