Test: some tests depending on rpm-ostree were not checking its presence

Add conditional skip to some tests that depend on rpm-ostree
availability, but were not checking for its presence. These tests would
previously fail if rpm-ostree is not available. They will be skipped
now.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-04-26 16:52:11 +02:00 committed by Simon de Vlieger
parent 33f3adfe5d
commit 5946a013ee
2 changed files with 2 additions and 0 deletions

View file

@ -91,6 +91,7 @@ class TestObjectStore(test.TestBase):
self.assertEqual(v, js[p])
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
@unittest.skipUnless(test.TestBase.have_rpm_ostree(), "rpm-ostree missing")
def test_show_commit(self):
repo_path = os.path.join(self.locate_test_data(), "sources/org.osbuild.ostree/data/repo")
ostree.show(repo_path, "d6243b0d0ca3dc2aaef2e0eb3e9f1f4836512c2921007f124b285f7c466464d8")

View file

@ -98,6 +98,7 @@ def test_rawfs(osbuild, fs_type):
@pytest.mark.skipif(not test.TestBase.have_tree_diff(), reason="tree-diff missing")
@pytest.mark.skipif(not test.TestBase.have_test_data(), reason="no test-data access")
@pytest.mark.skipif(not test.TestBase.can_bind_mount(), reason="root-only")
@pytest.mark.skipif(not test.TestBase.have_rpm_ostree(), reason="rpm-ostree missing")
def test_ostree(osbuild):
with osbuild as osb:
with open(os.path.join(test.TestBase.locate_test_data(),