curia.mock.docker_registry module¶
- curia.mock.docker_registry.setup_local_docker_registry(port: int = 3001, temp_folder: Path = PosixPath('temp'), username: str = 'local_test', password: str | None = None)¶
Sets up a local docker registry for testing purposes running on the given port. :param port: The port to run the registry on. :param temp_folder: The temp folder to use for the mock registry. :param username: The username to use for the local docker registry. :param password: The password to use for the local docker registry. If None, a random password will be generated.
- Returns:
tuple of the container id and a dictionary containing the username, password, and host that the docker
registry is running on.
- curia.mock.docker_registry.teardown_local_docker_registry(container_id: str, temp_folder: Path = PosixPath('temp'))¶
Tears down the local docker registry running on the given port and deletes the relevant temp files.
- curia.mock.docker_registry.using_local_docker_registry(port: int = 3001, temp_folder: Path = PosixPath('temp'), username: str = 'local_test', password: str | None = None)¶
Decorator for tests that require a local docker registry. Automatically sets up the registry, runs the wrapped function, and tears down the registry.
- Parameters:
port – The port to run the registry on.
temp_folder – The temp folder to use for the mock registry.
username – The username to use for the local docker registry.
password – The password to use for the local docker registry. If None, a random password will be generated.