Skip to content

Commit df07586

Browse files
authoredJul 15, 2024··
fix(modules): Mailpit container base API URL helper method (#643)
Minimal change to expose some helper methods on the `MailpitContainer`
1 parent 49ce5a5 commit df07586

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎modules/mailpit/testcontainers/mailpit/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ def stop(self, *args: Any, **kwargs: Any) -> None:
183183
def get_exposed_smtp_port(self) -> int:
184184
return int(self.get_exposed_port(self.smtp_port))
185185

186+
def get_exposed_ui_port(self) -> int:
187+
return int(self.get_exposed_port(self.ui_port))
188+
189+
def get_base_api_url(self) -> str:
190+
return f"http://{self.get_container_host_ip()}:{self.get_exposed_ui_port()}"
191+
186192

187193
class _TLSCertificates(NamedTuple):
188194
private_key: bytes

0 commit comments

Comments
 (0)
Please sign in to comment.