summaryrefslogtreecommitdiff
path: root/tests/unit/utils/test_standarddir.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/utils/test_standarddir.py')
-rw-r--r--tests/unit/utils/test_standarddir.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/unit/utils/test_standarddir.py b/tests/unit/utils/test_standarddir.py
index a16cb3c04..733832c6b 100644
--- a/tests/unit/utils/test_standarddir.py
+++ b/tests/unit/utils/test_standarddir.py
@@ -209,7 +209,9 @@ class TestStandardDir:
@pytest.mark.linux
@pytest.mark.parametrize('args_basedir', [True, False])
- def test_flatpak_runtimedir(self, monkeypatch, tmp_path, args_basedir):
+ @pytest.mark.parametrize('has_flatpak_id', [True, False])
+ def test_flatpak_runtimedir(self, monkeypatch, tmp_path,
+ args_basedir, has_flatpak_id):
runtime_path = tmp_path / 'runtime'
runtime_path.mkdir()
runtime_path.chmod(0o0700)
@@ -218,7 +220,11 @@ class TestStandardDir:
monkeypatch.setattr(version, 'is_flatpak', lambda: True)
monkeypatch.setenv('XDG_RUNTIME_DIR', str(runtime_path))
- monkeypatch.setenv('FLATPAK_ID', app_id)
+
+ if has_flatpak_id:
+ monkeypatch.setenv('FLATPAK_ID', app_id)
+ else:
+ monkeypatch.delenv('FLATPAK_ID', raising=False)
if args_basedir:
init_args = types.SimpleNamespace(basedir=str(tmp_path))