summaryrefslogtreecommitdiff
path: root/tests/unit/utils/test_standarddir.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-30 21:55:47 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-03-31 13:29:54 +0200
commita220fba14dec02db22da4042391337e09fe73b98 (patch)
tree369ccc0a151f7c188d3e749e870275afbfb002cb /tests/unit/utils/test_standarddir.py
parentd7913f78f65136308f18369ef95916200fc80cd4 (diff)
downloadqutebrowser-a220fba14dec02db22da4042391337e09fe73b98.tar.gz
qutebrowser-a220fba14dec02db22da4042391337e09fe73b98.zip
flatpak: Make things work without FLATPAK_ID
(cherry picked from commit 3b1bbc709cad66639eb7bf2285a0db2b361281e5)
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))