From 3abbbad2e53d6afd14668906bde30ec66e3a6030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 25 Mar 2025 12:34:37 +0100 Subject: [PATCH] fixup! Use a `Runtime` class to get information about container runtimes --- tests/test_container_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_container_utils.py b/tests/test_container_utils.py index 5b55d59..aeec210 100644 --- a/tests/test_container_utils.py +++ b/tests/test_container_utils.py @@ -20,7 +20,13 @@ def test_get_runtime_name_from_settings(mocker: MockerFixture, tmp_path: Path) - def test_get_runtime_name_linux(mocker: MockerFixture, tmp_path: Path) -> None: mocker.patch("dangerzone.settings.get_config_dir", return_value=tmp_path) mocker.patch("platform.system", return_value="Linux") - assert Runtime().name == "podman" + mocker.patch( + "dangerzone.container_utils.shutil.which", return_value="/usr/bin/podman" + ) + mocker.patch("dangerzone.container_utils.os.path.exists", return_value=True) + runtime = Runtime() + assert runtime.name == "podman" + assert runtime.path == Path("/usr/bin/podman") def test_get_runtime_name_non_linux(mocker: MockerFixture, tmp_path: Path) -> None: