Skip to content

Commit

Permalink
fix: added types to exec & tc_properties_get_tc_host (#561)
Browse files Browse the repository at this point in the history
#557 -
trying to solve this issue by adding types.

---------

Co-authored-by: Dandiggas <dadekugbe@googlemail.com>
  • Loading branch information
Dandiggas and Dandiggas committed May 17, 2024
1 parent 6f9376c commit 9eabb79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/testcontainers/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from os import environ
from os.path import exists
from pathlib import Path
from typing import Union

MAX_TRIES = int(environ.get("TC_MAX_TRIES", 120))
SLEEP_TIME = int(environ.get("TC_POOLING_INTERVAL", 1))
Expand Down Expand Up @@ -47,7 +48,7 @@ class TestcontainersConfiguration:
ryuk_reconnection_timeout: str = RYUK_RECONNECTION_TIMEOUT
tc_properties: dict[str, str] = field(default_factory=read_tc_properties)

def tc_properties_get_tc_host(self):
def tc_properties_get_tc_host(self) -> Union[str, None]:
return self.tc_properties.get("tc.host")

@property
Expand Down
2 changes: 1 addition & 1 deletion core/testcontainers/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_logs(self) -> tuple[bytes, bytes]:
raise ContainerStartException("Container should be started before getting logs")
return self._container.logs(stderr=False), self._container.logs(stdout=False)

def exec(self, command) -> tuple[int, str]:
def exec(self, command) -> tuple[int, bytes]:
if not self._container:
raise ContainerStartException("Container should be started before executing a command")
return self._container.exec_run(command)
Expand Down

0 comments on commit 9eabb79

Please sign in to comment.