diff --git a/install.py b/install.py index 41381f47e..bf4488127 100644 --- a/install.py +++ b/install.py @@ -6011,6 +6011,11 @@ def _install_standalone_folders( False when this machine has none, the run then going on to the platform question or hint. """ + if offline_requested(): + # Their folders are named by file lists this run cannot fetch: the + # first refusal ended an --offline run that asked nothing of EmuDeck + # on "No file list for emudeck". + return False manifests = [] for plat in STANDALONE_SOURCES: manifests.append(fetch_manifest(plat)) diff --git a/tests/test_install_experience.py b/tests/test_install_experience.py index 1c7dba215..43ac058b2 100644 --- a/tests/test_install_experience.py +++ b/tests/test_install_experience.py @@ -1166,6 +1166,28 @@ class ADetectedClosedFolderSaysWhereItCameFrom(unittest.TestCase): _source_of(install._install)) +class OfflineWithNothingFound(unittest.TestCase): + """An --offline run on a machine with nothing installed ended on "No + file list for emudeck", a platform nobody asked about: the standalone + folders are named by file lists that run cannot fetch.""" + + def test_the_hint_is_given_and_no_other_platform_named(self): + with FakeRepository() as repo: + home = repo.root / "home" + home.mkdir() + env = {**repo.env(), "HOME": str(home), "XDG_CONFIG_HOME": str(home / ".config"), + "RETROBIOS_OS": "linux"} + proc = subprocess.run( + [sys.executable, str(REPO_ROOT / "install.py"), "--offline", "--check", + "--no-input"], + env=env, capture_output=True, text=True, timeout=60, + stdin=subprocess.DEVNULL) + said = proc.stdout + proc.stderr + self.assertEqual(proc.returncode, 1, said) + self.assertNotIn("emudeck", said.lower()) + self.assertIn("Use --platform and --dest", said) + + def _source_of(function) -> str: import inspect