From d3128ebaefd12973c95da98157fd8084c5299912 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Sep 2024 12:13:31 +0200 Subject: [PATCH] fixup! add "store" to OSBuild test class --- test/run/test_stages.py | 2 +- test/test.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/run/test_stages.py b/test/run/test_stages.py index 5b7f4412d..581b0687e 100644 --- a/test/run/test_stages.py +++ b/test/run/test_stages.py @@ -234,7 +234,7 @@ def test_run_stage_diff(tmp_path, osb, test_dir): # cache the downloaded data for the sources by copying # it to self.cache, which is going to be used to initialize # the osbuild cache with. - osb.copy_source_data(osb.cache_from, "org.osbuild.files") + osb.copy_source_data(osb.store, "org.osbuild.files") @unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access") diff --git a/test/test.py b/test/test.py index 17bbcdbed..10a5dd325 100644 --- a/test/test.py +++ b/test/test.py @@ -302,6 +302,7 @@ class OSBuild(contextlib.AbstractContextManager): def __init__(self, *, cache_from=None): self._cache_from = cache_from + self.store = None def __enter__(self): self._exitstack = contextlib.ExitStack() @@ -336,10 +337,6 @@ def __exit__(self, exc_type, exc_value, exc_tb): self._cachedir = None self._exitstack = None - @property - def cache_from(self) -> str: - return self._cache_from - @staticmethod def _print_result(code, data_stdout, data_stderr, log): print(f"osbuild failed with: {code}") @@ -518,6 +515,7 @@ def osbuild_fixture(): store = tempfile.mkdtemp(prefix="osbuild-test-", dir="/var/tmp") cleanup_dir = store with OSBuild(cache_from=store) as osb: + osb.store = store yield osb if cleanup_dir: shutil.rmtree(cleanup_dir)