mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-13 13:02:56 +00:00
Add a way to easily test units
This commit is contained in:
@@ -8,22 +8,23 @@ LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"package_manager, cmd",
|
||||
"package_manager, version_arg",
|
||||
[
|
||||
("apt", "--version"),
|
||||
("conda", "--version"),
|
||||
("mamba", "--version"),
|
||||
("npm", "--version"),
|
||||
("pip", "--version"),
|
||||
],
|
||||
("pip", "--version")
|
||||
]
|
||||
)
|
||||
def test_package_manager(container, package_manager, cmd):
|
||||
def test_package_manager(container, package_manager, version_arg):
|
||||
"""Test the notebook start-notebook script"""
|
||||
LOGGER.info(
|
||||
f"Test that the package manager {package_manager} is working properly ..."
|
||||
)
|
||||
c = container.run(
|
||||
tty=True, command=["start.sh", "bash", "-c", f"{package_manager} {cmd}"]
|
||||
tty=True,
|
||||
command=["start.sh", "bash", "-c", f"{package_manager} {version_arg}"]
|
||||
)
|
||||
rv = c.wait(timeout=5)
|
||||
logs = c.logs(stdout=True).decode("utf-8")
|
||||
|
@@ -9,7 +9,8 @@ LOGGER = logging.getLogger(__name__)
|
||||
def test_pandoc(container):
|
||||
"""Pandoc shall be able to convert MD to HTML."""
|
||||
c = container.run(
|
||||
tty=True, command=["start.sh", "bash", "-c", 'echo "**BOLD**" | pandoc']
|
||||
tty=True,
|
||||
command=["start.sh", "bash", "-c", 'echo "**BOLD**" | pandoc']
|
||||
)
|
||||
c.wait(timeout=10)
|
||||
logs = c.logs(stdout=True).decode("utf-8")
|
||||
|
@@ -8,7 +8,11 @@ LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"env,expected_server", [(["JUPYTER_ENABLE_LAB=yes"], "lab"), (None, "notebook"), ],
|
||||
"env,expected_server",
|
||||
[
|
||||
(["JUPYTER_ENABLE_LAB=yes"], "lab"),
|
||||
(None, "notebook")
|
||||
]
|
||||
)
|
||||
def test_start_notebook(container, http_client, env, expected_server):
|
||||
"""Test the notebook start-notebook script"""
|
||||
|
Reference in New Issue
Block a user