tests: Skip a test for missing OCR files on Qubes

We have a container-specific test that deals with missing OCR files in
the container image. This test _can_ be run under Qubes, and it may
fail since it requires Podman.

Make the pytest guard more strict and don't allow running this test on
Qubes.

Also, fix a typo in the word "omission".
This commit is contained in:
Alex Pyrgiotis 2024-06-27 22:11:50 +03:00
parent c89ef580e0
commit 4ea0650f42
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -5,6 +5,7 @@ from pathlib import Path
import pytest
from dangerzone.isolation_provider.container import Container
from dangerzone.isolation_provider.qubes import is_qubes_native_conversion
from dangerzone.logic import DangerzoneCore
@ -12,8 +13,11 @@ from dangerzone.logic import DangerzoneCore
# NOTE: We skip running this test on Windows/MacOS, because our current CI cannot run
# Docker in these platforms. It's not a problem anyways, because the result should be
# the same in all container-based platforms.
@pytest.mark.skipif(platform.system() != "Linux", reason="Container-specific")
def test_ocr_ommisions() -> None:
@pytest.mark.skipif(
platform.system() != "Linux" or is_qubes_native_conversion(),
reason="Container-specific",
)
def test_ocr_omissions() -> None:
# Create the command that will list all the installed languages in the container
# image.
command = [Container.get_runtime(), "run"]