From 17fb80ad51fa1bd60d4c8e9b348839503ee07c35 Mon Sep 17 00:00:00 2001 From: Boran Miao <84240213+realRurichan@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:13:12 +0800 Subject: [PATCH] test: quote emulator installer paths with spaces --- tools/tests/test_emulators_install.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/tests/test_emulators_install.py b/tools/tests/test_emulators_install.py index 03d135bda..81dbf1038 100644 --- a/tools/tests/test_emulators_install.py +++ b/tools/tests/test_emulators_install.py @@ -1,5 +1,6 @@ import os from pathlib import Path +import shlex import subprocess import tempfile import unittest @@ -10,7 +11,7 @@ SCRIPT = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/dr class EmulatorsInstallTest(unittest.TestCase): def run_install(self, failure=""): - with tempfile.TemporaryDirectory() as directory: + with tempfile.TemporaryDirectory(prefix="emulator install 'quoted' ") as directory: root = Path(directory) bin_dir = root / "bin" bin_dir.mkdir() @@ -41,8 +42,8 @@ class EmulatorsInstallTest(unittest.TestCase): path.chmod(0o755) script = root / "install" script.write_text(SCRIPT.read_text() - .replace("/usr/local/bin/droiddeck-flatpak install", str(helper) + " install") - .replace("/usr/local/bin/PPSSPPSDL", str(launcher))) + .replace("/usr/local/bin/droiddeck-flatpak install", shlex.quote(str(helper)) + " install") + .replace("/usr/local/bin/PPSSPPSDL", shlex.quote(str(launcher)))) env = dict(os.environ, PATH=str(bin_dir) + os.pathsep + os.environ["PATH"], CALLS=str(calls), FAILURE=failure) result = subprocess.run(["bash", str(script), "install"], env=env,