Tomodachi Testcontainers
tomodachi_testcontainers
DockerContainer
Bases: DockerContainer
, ABC
Abstract class for generic Docker containers.
PARAMETER | DESCRIPTION |
---|---|
*args
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/common/container.py
log_message_on_container_start
abstractmethod
get_container_host_ip
Source code in src/tomodachi_testcontainers/containers/common/container.py
get_container_internal_ip
get_container_gateway_ip
docker_inspect
start
stop
Source code in src/tomodachi_testcontainers/containers/common/container.py
EphemeralDockerImage
EphemeralDockerImage(dockerfile=None, context=None, target=None, docker_client_kwargs=None, *, remove_image_on_exit=True)
Builds a Docker image from a given Dockerfile and removes it when the context manager exits.
PARAMETER | DESCRIPTION |
---|---|
dockerfile
|
TYPE:
|
context
|
TYPE:
|
target
|
TYPE:
|
docker_client_kwargs
|
TYPE:
|
remove_image_on_exit
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/common/image.py
WebContainer
WebContainer(image, internal_port, edge_port=None, http_healthcheck_path=None, disable_logging=False, **kwargs)
Bases: DockerContainer
, ABC
Abstract class for web application containers.
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
http_healthcheck_path
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/common/web.py
get_internal_url
get_external_url
start
DynamoDBAdminContainer
DynamoDBAdminContainer(dynamo_endpoint, image='aaronshaf/dynamodb-admin:latest', internal_port=8001, edge_port=None, region_name=None, disable_logging=False, **kwargs)
Bases: WebContainer
DynamoDB Admin container.
Configuration environment variables (set on host machine):
AWS_REGION
orAWS_DEFAULT_REGION
- defaults tous-east-1
PARAMETER | DESCRIPTION |
---|---|
dynamo_endpoint
|
TYPE:
|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
region_name
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/dynamodb_admin.py
region_name
instance-attribute
region_name = region_name or getenv('AWS_REGION') or getenv('AWS_DEFAULT_REGION') or 'us-east-1'
aws_secret_access_key
instance-attribute
LocalStackContainer
LocalStackContainer(image='localstack/localstack:3', internal_port=4566, edge_port=None, region_name=None, disable_logging=False, **kwargs)
Bases: WebContainer
LocalStack container.
Configuration environment variables (set on host machine):
AWS_REGION
orAWS_DEFAULT_REGION
- defaults tous-east-1
AWS_ACCESS_KEY_ID
- defaults totesting
AWS_SECRET_ACCESS_KEY
- defaults totesting
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
region_name
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/localstack.py
region_name
instance-attribute
region_name = region_name or getenv('AWS_REGION') or getenv('AWS_DEFAULT_REGION') or 'us-east-1'
aws_secret_access_key
instance-attribute
log_message_on_container_start
get_aws_client_config
Source code in src/tomodachi_testcontainers/containers/localstack.py
MinioContainer
MinioContainer(image='minio/minio:latest', s3_api_internal_port=9000, s3_api_edge_port=None, console_internal_port=9001, console_edge_port=None, region_name=None, disable_logging=False, **kwargs)
Bases: WebContainer
Minio container.
Configuration environment variables (set on host machine):
AWS_REGION
orAWS_DEFAULT_REGION
- defaults tous-east-1
MINIO_ROOT_USER
- defaults tominioadmin
MINIO_ROOT_PASSWORD
- defaults tominioadmin
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
s3_api_internal_port
|
TYPE:
|
s3_api_edge_port
|
TYPE:
|
console_internal_port
|
TYPE:
|
console_edge_port
|
TYPE:
|
region_name
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/minio.py
region_name
instance-attribute
region_name = region_name or getenv('AWS_REGION') or getenv('AWS_DEFAULT_REGION') or 'us-east-1'
minio_root_password
instance-attribute
log_message_on_container_start
get_aws_client_config
Source code in src/tomodachi_testcontainers/containers/minio.py
MotoContainer
MotoContainer(image='motoserver/moto:latest', internal_port=5000, edge_port=None, region_name=None, disable_logging=False, **kwargs)
Bases: WebContainer
Moto container.
Configuration environment variables (set on host machine):
AWS_REGION
orAWS_DEFAULT_REGION
- defaults tous-east-1
AWS_ACCESS_KEY_ID
- defaults totesting
AWS_SECRET_ACCESS_KEY
- defaults totesting
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
region_name
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/moto.py
region_name
instance-attribute
region_name = region_name or getenv('AWS_REGION') or getenv('AWS_DEFAULT_REGION') or 'us-east-1'
aws_secret_access_key
instance-attribute
log_message_on_container_start
get_aws_client_config
Source code in src/tomodachi_testcontainers/containers/moto.py
start
TomodachiContainer
TomodachiContainer(image, internal_port=9700, edge_port=None, http_healthcheck_path=None, *, export_coverage=False, disable_logging=False, **kwargs)
Bases: WebContainer
Tomodachi container.
Configuration environment variables (set on host machine):
TOMODACHI_TESTCONTAINER_EXPORT_COVERAGE
- defaults toFalse
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
http_healthcheck_path
|
TYPE:
|
export_coverage
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/tomodachi.py
log_message_on_container_start
start
Source code in src/tomodachi_testcontainers/containers/tomodachi.py
WireMockContainer
WireMockContainer(image='wiremock/wiremock:latest', internal_port=8080, edge_port=None, mapping_stubs=None, mapping_files=None, *, verbose=False, disable_logging=False, **kwargs)
Bases: WebContainer
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
mapping_stubs
|
TYPE:
|
mapping_files
|
TYPE:
|
verbose
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/wiremock.py
MAPPING_STUBS_DIR
class-attribute
instance-attribute
MAPPING_FILES_DIR
class-attribute
instance-attribute
mapping_stubs
instance-attribute
mapping_stubs = mapping_stubs or Path(mapping_stubs_env) if mapping_stubs_env else None
mapping_files
instance-attribute
mapping_files = mapping_files or Path(mapping_files_env) if mapping_files_env else None
log_message_on_container_start
start
load_mappings_from_files
delete_mappings
DatabaseContainer
Bases: DockerContainer
, ABC
Abstract class for relational database containers.
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/common/database.py
get_internal_url
Source code in src/tomodachi_testcontainers/containers/common/database.py
get_external_url
Source code in src/tomodachi_testcontainers/containers/common/database.py
start
PARAMETER | DESCRIPTION |
---|---|
timeout
|
TYPE:
|
MySQLContainer
MySQLContainer(image='mysql:8', internal_port=3306, edge_port=None, drivername=None, username=None, root_password=None, password=None, database=None, disable_logging=False, **kwargs)
Bases: DatabaseContainer
MySQL container.
Configuration environment variables (set on host machine):
MYSQL_DRIVERNAME
- defaults tomysql+pymysql
MYSQL_USER
- defaults tousername
MYSQL_ROOT_PASSWORD
- defaults toroot
MYSQL_PASSWORD
- defaults topassword
MYSQL_DATABASE
- defaults todb
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
drivername
|
TYPE:
|
username
|
TYPE:
|
root_password
|
TYPE:
|
password
|
TYPE:
|
database
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/mysql.py
drivername
instance-attribute
drivername = drivername or getenv('MYSQL_DRIVERNAME') or 'mysql+pymysql'
root_password
instance-attribute
root_password = root_password or getenv('MYSQL_ROOT_PASSWORD') or 'root'
PostgreSQLContainer
PostgreSQLContainer(image='postgres:16', internal_port=5432, edge_port=None, drivername=None, username=None, password=None, database=None, disable_logging=False, **kwargs)
Bases: DatabaseContainer
PostgreSQL container.
Configuration environment variables (set on host machine):
POSTGRES_DRIVERNAME
- defaults topostgresql+psycopg
POSTGRES_USER
- defaults tousername
POSTGRES_PASSWORD
- defaults topassword
POSTGRES_DB
- defaults todb
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
drivername
|
TYPE:
|
username
|
TYPE:
|
password
|
TYPE:
|
database
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/postgres.py
drivername
instance-attribute
drivername = drivername or getenv('POSTGRES_DRIVERNAME') or 'postgresql+psycopg'
SFTPContainer
SFTPContainer(image='atmoz/sftp:latest', internal_port=22, edge_port=None, disable_logging=False, **kwargs)
Bases: DockerContainer
PARAMETER | DESCRIPTION |
---|---|
image
|
TYPE:
|
internal_port
|
TYPE:
|
edge_port
|
TYPE:
|
disable_logging
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/sftp.py
authorized_private_key
instance-attribute
log_message_on_container_start
get_internal_conn_details
get_external_conn_details
get_host_public_key
get_internal_known_host
get_external_known_host
get_known_hosts
Source code in src/tomodachi_testcontainers/containers/sftp.py
add_authorized_key
PARAMETER | DESCRIPTION |
---|---|
username
|
TYPE:
|
uid
|
TYPE:
|
gid
|
TYPE:
|
public_key
|
TYPE:
|
Source code in src/tomodachi_testcontainers/containers/sftp.py
start
PARAMETER | DESCRIPTION |
---|---|
timeout
|
TYPE:
|