Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
André committed Feb 10, 2025
1 parent 1c850c7 commit 5627106
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 5 additions & 5 deletions nova/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
):
if host is None:
host = config("NOVA_API", default=INTERNAL_CLUSTER_NOVA_API)

if username is None:
username = config("NOVA_USERNAME", default=None)

Expand Down Expand Up @@ -127,7 +127,7 @@ def __init__(

async def close(self):
return await self._api_client.close()

@staticmethod
def _host_with_prefix(host: str) -> str:
"""
Expand All @@ -140,11 +140,11 @@ def _host_with_prefix(host: str) -> str:

if host.startswith("http") and not is_wabo_host:
return host

if host.startswith("http") and is_wabo_host:
return host.replace("http://", "https://")

if is_wabo_host:
return f"https://{host}"

return f"http://{host}"
5 changes: 1 addition & 4 deletions tests/test_gateway.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import pytest

from nova.gateway import ApiGateway
Expand All @@ -8,7 +6,7 @@
@pytest.mark.asyncio
async def test_api_gateway_host():
"""
NOVA_API env does not provide any prefix,
NOVA_API env might not provide any prefix,
thus ApiGateway should make sure to use the prefix depending on the environment.
https://wandelbots.atlassian.net/browse/RPS-1208
Expand All @@ -28,4 +26,3 @@ async def test_api_gateway_host():
expected_host = "https://someinstance.wandelbots.io"
gateway = ApiGateway(host="someinstance.wandelbots.io")
assert gateway._host == expected_host

0 comments on commit 5627106

Please sign in to comment.