stage: pass store instead of cache & var

Instead of passing separate `cache` and `var` variables, which are
both determined by the store, just pass the store.
This commit is contained in:
Christian Kellner 2021-01-05 20:02:36 +01:00 committed by Tom Gundersen
parent de021b468a
commit d028ea5b16
2 changed files with 11 additions and 18 deletions

View file

@ -13,6 +13,7 @@ import osbuild
import osbuild.meta
from osbuild.formats import v1 as fmt
from osbuild.monitor import NullMonitor
from osbuild.objectstore import ObjectStore
from osbuild.pipeline import detect_host_runner
from .. import test
@ -46,16 +47,15 @@ class TestDescriptions(unittest.TestCase):
with tempfile.TemporaryDirectory() as tmpdir:
data = pathlib.Path(tmpdir, "data")
cache = pathlib.Path(tmpdir, "cache")
storedir = pathlib.Path(tmpdir, "store")
root = pathlib.Path("/")
runner = detect_host_runner()
monitor = NullMonitor(sys.stderr.fileno())
libdir = os.path.abspath(os.curdir)
store = ObjectStore(storedir)
data.mkdir()
for p in [data, cache]:
p.mkdir()
res = stage.run(data, runner, root, cache, monitor, libdir)
res = stage.run(data, runner, root, store, monitor, libdir)
self.assertEqual(res.success, True)
self.assertEqual(res.id, stage.id)