Skip to content

Commit

Permalink
Fix issues from recent merges
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranquility2 committed Nov 16, 2024
1 parent cf6ca6b commit b8e76bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/testcontainers/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from os import environ
from os.path import exists
from pathlib import Path
from typing import Optional, Union
from typing import Optional, Union, cast


class ConnectionMode(Enum):
Expand All @@ -19,7 +19,7 @@ def use_mapped_port(self) -> bool:
This is true for everything but bridge mode.
"""
if self == self.bridge_ip:
if cast(str, self) == self.bridge_ip:
return False
return True

Expand All @@ -43,7 +43,7 @@ def get_user_overwritten_connection_mode() -> Optional[ConnectionMode]:
"""
Return the user overwritten connection mode.
"""
connection_mode: str | None = environ.get("TESTCONTAINERS_CONNECTION_MODE")
connection_mode: Union[str, None] = environ.get("TESTCONTAINERS_CONNECTION_MODE")
if connection_mode:
try:
return ConnectionMode(connection_mode)
Expand Down
2 changes: 1 addition & 1 deletion core/testcontainers/core/docker_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def get_connection_mode(self) -> ConnectionMode:
# default for DinD
return ConnectionMode.gateway_ip

def host(self) -> Optional[str]:
def host(self) -> str:
"""
Get the hostname or ip address of the docker host.
"""
Expand Down

0 comments on commit b8e76bc

Please sign in to comment.