Skip to content

Commit 32d45c7

Browse files
committed
type annotation
1 parent f9662f6 commit 32d45c7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

eventsourcingdb/container.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class Container:
1313
def __init__(
1414
self,
15-
):
15+
) -> None:
1616
self._image_name: str = 'thenativeweb/eventsourcingdb'
1717
self._image_tag: str = 'latest'
1818
self._api_token: str = 'secret'
@@ -57,7 +57,7 @@ def _create_container(self) -> None:
5757
detach=True,
5858
) # type: ignore
5959

60-
def _extract_port_from_container_info(self, container_info):
60+
def _extract_port_from_container_info(self, container_info) -> int | None:
6161
port = None
6262
valid_mapping = True
6363
port_mappings = None
@@ -95,7 +95,7 @@ def _fetch_mapped_port(self) -> None:
9595
self._stop_and_remove_container()
9696
raise RuntimeError('Failed to determine mapped port')
9797

98-
def _get_container_info(self):
98+
def _get_container_info(self) -> dict | None:
9999
if self._container is None:
100100
return None
101101
return self._docker_client.api.inspect_container(self._container.id)
@@ -142,7 +142,7 @@ def _pull_or_get_image(self) -> None:
142142
except errors.APIError as e:
143143
self._handle_image_pull_error(e)
144144

145-
def _handle_image_pull_error(self, error):
145+
def _handle_image_pull_error(self, error) -> None:
146146
image_name = f"{self._image_name}:{self._image_tag}"
147147
try:
148148
self._docker_client.images.get(image_name)
@@ -211,7 +211,7 @@ def _check_endpoint_available(self, url: str) -> bool:
211211
return self._check_response_ok(response)
212212

213213
# pylint: disable=R6301
214-
def _check_response_ok(self, response) -> bool:
214+
def _check_response_ok(self, response: requests.Response) -> bool:
215215
return response is not None and response.status_code == HTTPStatus.OK
216216

217217
def with_api_token(self, token: str) -> 'Container':

0 commit comments

Comments
 (0)