Skip to content

Commit cd92717

Browse files
committed
Add type annotations for keycloak.
1 parent 47a43ea commit cd92717

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

keycloak/testcontainers/keycloak/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,33 @@ class KeycloakContainer(DockerContainer):
3535
KEYCLOAK_USER = os.environ.get("KEYCLOAK_USER", "test")
3636
KEYCLOAK_PASSWORD = os.environ.get("KEYCLOAK_PASSWORD", "test")
3737

38-
def __init__(self, image="jboss/keycloak:latest"):
38+
def __init__(self, image="jboss/keycloak:latest") -> None:
3939
super(KeycloakContainer, self).__init__(image=image)
4040
self.port_to_expose = 8080
4141
self.with_exposed_ports(self.port_to_expose)
4242

43-
def _configure(self):
43+
def _configure(self) -> None:
4444
self.with_env("KEYCLOAK_USER", self.KEYCLOAK_USER)
4545
self.with_env("KEYCLOAK_PASSWORD", self.KEYCLOAK_PASSWORD)
4646

47-
def get_url(self):
47+
def get_url(self) -> str:
4848
host = self.get_container_host_ip()
4949
port = self.get_exposed_port(self.port_to_expose)
5050
return "http://{}:{}".format(host, port)
5151

5252
@wait_container_is_ready(requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout)
53-
def _connect(self):
53+
def _connect(self) -> None:
5454
url = self.get_url()
5555
response = requests.get("{}/auth".format(url), timeout=1)
5656
response.raise_for_status()
5757

58-
def start(self):
58+
def start(self) -> "KeycloakContainer":
5959
self._configure()
6060
super().start()
6161
self._connect()
6262
return self
6363

64-
def get_client(self, **kwargs):
64+
def get_client(self, **kwargs) -> KeycloakAdmin:
6565
default_kwargs = dict(
6666
server_url="{}/auth/".format(self.get_url()),
6767
username=self.KEYCLOAK_USER,

0 commit comments

Comments
 (0)