From: Michael Tremer Date: Thu, 25 Jan 2024 16:04:44 +0000 (+0000) Subject: tests: Migrate other Python tests to the new framework X-Git-Tag: 0.9.30~1250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abb05de8a851c457146b967744b54b264cc862e6;p=pakfire.git tests: Migrate other Python tests to the new framework Signed-off-by: Michael Tremer --- diff --git a/tests/python/jail.py b/tests/python/jail.py index 7c0f64171..265f7e66a 100755 --- a/tests/python/jail.py +++ b/tests/python/jail.py @@ -1,20 +1,16 @@ #!/usr/bin/python3 import logging -import os import pakfire -import unittest -class JailTests(unittest.TestCase): +import tests + +class JailTests(tests.TestCase): """ This tests the execute command """ def setUp(self): - path = os.environ.get("TEST_STUB_ROOT") - if not path: - raise RuntimeError("TEST_STUB_ROOT is not defined") - - self.pakfire = pakfire.Pakfire(path) + self.pakfire = self.setup_pakfire() def test_execute(self): r = self.pakfire.execute(["/command", "exit-with-code", "0"]) @@ -150,4 +146,4 @@ class JailTests(unittest.TestCase): if __name__ == "__main__": - unittest.main() + tests.main() diff --git a/tests/python/package.py b/tests/python/package.py index 0aa2a585a..3b51b6744 100755 --- a/tests/python/package.py +++ b/tests/python/package.py @@ -1,19 +1,15 @@ #!/usr/bin/python3 import os -import pakfire -import unittest -class Test(unittest.TestCase): +import tests + +class PackageTest(tests.TestCase): """ This tests the Package class """ def setUp(self): - path = os.environ.get("TEST_STUB_ROOT") - if not path: - raise RuntimeError("TEST_STUB_ROOT is not defined") - - self.pakfire = pakfire.Pakfire(path) + self.pakfire = self.setup_pakfire() def test_open(self): path = os.path.join( @@ -94,4 +90,4 @@ class Test(unittest.TestCase): if __name__ == "__main__": - unittest.main() + tests.main()