From: Michael Tremer Date: Fri, 18 Oct 2024 16:28:33 +0000 (+0000) Subject: tests: python: Load the configuration file X-Git-Tag: 0.9.30~1000 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d908c5c812abca4053f248839f6fd6ea7801235;p=pakfire.git tests: python: Load the configuration file Signed-off-by: Michael Tremer --- diff --git a/tests/python/tests.py b/tests/python/tests.py index 49a5d2a45..83a9de02a 100644 --- a/tests/python/tests.py +++ b/tests/python/tests.py @@ -48,7 +48,7 @@ class TestCase(unittest.TestCase): # Return a new context return pakfire.Ctx(path=path, **kwargs) - def setup_pakfire(self, ctx=None, path=None, **kwargs): + def setup_pakfire(self, ctx=None, path=None, config=None, **kwargs): """ Sets up a new Pakfire environment """ @@ -56,10 +56,14 @@ class TestCase(unittest.TestCase): if ctx is None: ctx = self.setup_ctx() + if config is None: + config = os.environ.get("TEST_CONFIG_FILE") + if path is None: path = os.environ.get("TEST_STUB_ROOT") - return pakfire.Pakfire(ctx=ctx, path=path, **kwargs) + with open(config, "r") as f: + return pakfire.Pakfire(ctx=ctx, path=path, conf=f, **kwargs) def path(self, *args, **kwargs): """