@@ -34,24 +34,15 @@ class MinioContainer(DockerContainer):
34
34
... retrieved_content = client.get_object("test", "testfile.txt").data
35
35
"""
36
36
37
- def __init__ (
38
- self ,
39
- image = "minio/minio:RELEASE.2022-12-02T19-19-22Z" ,
40
- port_to_expose = 9000 ,
41
- access_key = "minioadmin" ,
42
- secret_key = "minioadmin" ,
43
- ** kwargs ,
44
- ):
37
+ def __init__ (self , image : str = "minio/minio:RELEASE.2022-12-02T19-19-22Z" ,
38
+ port_to_expose : int = 9000 , access_key : str = "minioadmin" ,
39
+ secret_key : str = "minioadmin" , ** kwargs ) -> None :
45
40
"""
46
41
Args:
47
- image (str, optional): The Docker image to use for the Minio container.
48
- Defaults to "minio/minio:RELEASE.2022-12-02T19-19-22Z".
49
- port_to_expose (int, optional): The port to expose on the container.
50
- Defaults to 9000.
51
- access_key (str, optional): The access key for client connections.
52
- Defaults to "minioadmin".
53
- secret_key (str, optional): The secret key for client connections.
54
- Defaults to "minioadmin".
42
+ image: Docker image to use for the MinIO container.
43
+ port_to_expose: Port to expose on the container.
44
+ access_key: Access key for client connections.
45
+ secret_key: Secret key for client connections.
55
46
"""
56
47
super (MinioContainer , self ).__init__ (image , ** kwargs )
57
48
self .port_to_expose = port_to_expose
@@ -96,14 +87,14 @@ def get_config(self) -> dict:
96
87
}
97
88
98
89
@wait_container_is_ready (ConnectionError )
99
- def _healthcheck (self ):
90
+ def _healthcheck (self ) -> None :
100
91
"""This is an internal method used to check if the Minio container
101
92
is healthy and ready to receive requests."""
102
93
url = f"http://{ self .get_config ()['endpoint' ]} /minio/health/live"
103
94
response : Response = get (url )
104
95
response .raise_for_status ()
105
96
106
- def start (self ):
97
+ def start (self ) -> "MinioContainer" :
107
98
"""This method starts the Minio container and runs the healthcheck
108
99
to verify that the container is ready to use."""
109
100
super ().start ()
0 commit comments