Test: handle non-existence of /run/osbuild in test/run/test_mount.py

The directory does not exist when the unit test is run in CI. Handle
this case by ensuring that parent directories are created as needed.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-04-06 16:13:28 +02:00 committed by Tomáš Hozza
parent 1a2776bf1b
commit 975965510b

View file

@ -27,7 +27,7 @@ def tmpdir_fixture():
@contextmanager
def make_arguments(opts):
os.mkdir("/run/osbuild/api")
os.makedirs("/run/osbuild/api")
with open("/run/osbuild/api/arguments", "w", encoding="utf-8") as f:
json.dump(opts, f)
try: