mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-05 21:21:49 +02:00
fixup! Use a Runtime
class to get information about container runtimes
This commit is contained in:
parent
a70a684fca
commit
3abbbad2e5
1 changed files with 7 additions and 1 deletions
|
@ -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:
|
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("dangerzone.settings.get_config_dir", return_value=tmp_path)
|
||||||
mocker.patch("platform.system", return_value="Linux")
|
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:
|
def test_get_runtime_name_non_linux(mocker: MockerFixture, tmp_path: Path) -> None:
|
||||||
|
|
Loading…
Reference in a new issue