Files
docker-stacks/tests/utils/run_command.py
2025-03-21 12:15:16 +00:00

20 lines
501 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
from tests.utils.tracked_container import TrackedContainer
LOGGER = logging.getLogger(__name__)
def run_command(
container: TrackedContainer,
command: str,
timeout: int = 5,
) -> str:
LOGGER.info(f"Test that the command '{command}' is working properly ...")
return container.run_and_wait(
timeout=timeout,
command=["bash", "-c", command],
)