From d48f4eb4ffed0d028d4df2e6d402753919a83834 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 30 Nov 2022 12:54:01 +0100 Subject: [PATCH] test/osbuild: use proper object in stage run test Create a proper `ObjectStore.Object` to use as tree for the `run` method of `Stage`, since that is what is also normally passed to it from `Pipeline.run`. It prepares for a future where `Object` is not just used as `os.PathLike`. --- test/mod/test_osbuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/mod/test_osbuild.py b/test/mod/test_osbuild.py index 89f81cff..e01a2f4c 100644 --- a/test/mod/test_osbuild.py +++ b/test/mod/test_osbuild.py @@ -40,16 +40,16 @@ class TestDescriptions(unittest.TestCase): with tempfile.TemporaryDirectory() as tmpdir: - data = pathlib.Path(tmpdir, "data") storedir = pathlib.Path(tmpdir, "store") root = pathlib.Path("/") runner = Runner(index.detect_host_runner()) monitor = NullMonitor(sys.stderr.fileno()) libdir = os.path.abspath(os.curdir) store = ObjectStore(storedir) - data.mkdir() - res = stage.run(data, runner, root, store, monitor, libdir) + with ObjectStore(storedir) as store: + data = store.new(stage.id) + res = stage.run(data, runner, root, store, monitor, libdir) self.assertEqual(res.success, True) self.assertEqual(res.id, stage.id)