Skip to content

Commit

Permalink
Revert "Minor tweaks to aid in local integration testing"
Browse files Browse the repository at this point in the history
This reverts commit 44c884e.
  • Loading branch information
chrisvanrun committed Jan 16, 2025
1 parent 1a26069 commit 7fb5082
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 2 additions & 5 deletions gcapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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__(
Expand Down
6 changes: 1 addition & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@ 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(
local_api_url,
verify=False,
headers={"Authorization": f"Bearer {ADMIN_TOKEN}"},
)

r.raise_for_status()
local_gc_running = True
except httpx.HTTPError:
Expand Down

0 comments on commit 7fb5082

Please sign in to comment.