diff --git a/sources/test/test_ostree_source.py b/sources/test/test_ostree_source.py index 6909390d..8d1ab750 100644 --- a/sources/test/test_ostree_source.py +++ b/sources/test/test_ostree_source.py @@ -3,18 +3,23 @@ import pathlib import tempfile +import pytest + +from osbuild.testutil import has_executable from osbuild.testutil.net import http_serve_directory, https_serve_directory from osbuild.util import ostree SOURCES_NAME = "org.osbuild.ostree" +@pytest.mark.skipif(not has_executable("ostree"), reason="need ostree") def test_ostree_source_not_exists(tmp_path, sources_service): checksum = "sha256:1111111111111111111111111111111111111111111111111111111111111111" sources_service.setup({"cache": tmp_path, "options": {}}) assert not sources_service.exists(checksum, None) +@pytest.mark.skipif(not has_executable("ostree"), reason="need ostree") def test_ostree_source_exists(tmp_path, sources_service): sources_service.setup({"cache": tmp_path, "options": {}}) root = tmp_path / "org.osbuild.ostree" / "repo" @@ -41,6 +46,7 @@ def make_repo(root): return ostree.cli("commit", f"--repo={root}", "--orphan", empty_tmpdir).stdout.rstrip() +@pytest.mark.skipif(not has_executable("ostree"), reason="need ostree") def test_ostree_pull_plain(tmp_path, sources_service): fake_httpd_root = tmp_path / "fake-httpd-root" fake_httpd_root.mkdir(exist_ok=True) @@ -53,6 +59,7 @@ def test_ostree_pull_plain(tmp_path, sources_service): assert sources_service.exists("sha256:" + fake_commit, None) +@pytest.mark.skipif(not has_executable("ostree"), reason="need ostree") def test_ostree_pull_plain_mtls(tmp_path, sources_service, monkeypatch): fake_httpd_root = tmp_path / "fake-httpd-root" fake_httpd_root.mkdir(exist_ok=True)