mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-05 01:23:45 -06:00
docs: first install for the full screen
The one-liner opens the full screen, and the page walked through the line questions. It now shows the first screen, the keys and the controller, Install, the copy from an old card and the result titles. Troubleshooting no longer asks to move a nested bios folder by hand.
This commit is contained in:
1 parent
e534f11713
commit
bbbf551140
5 files changed
+73
-57
No files matched your search
+16
-13
@@ -699,13 +699,14 @@ class FirstInstallWalkthrough(unittest.TestCase):
|
||||
step3 = _section(self.run, "The file index and the download")
|
||||
step4 = _section(self.run, "The end of the run")
|
||||
step5 = _section(self.run, "A later check")
|
||||
# First install names the three endings a run prints, and no count:
|
||||
# a figure from one setup read as the size of every install.
|
||||
# First install names the three endings the full screen shows as
|
||||
# its title, and no count: a figure from one setup read as the size
|
||||
# of every install.
|
||||
source = (ROOT / "install.py").read_text(encoding="utf-8")
|
||||
for ending in ("Done.", "Finished with errors.", "Nothing was installed."):
|
||||
for ending in ("Done", "Finished with errors", "Nothing installed"):
|
||||
with self.subTest(ending=ending):
|
||||
self.assertIn(f"`{ending}`", _section(self.text, "5. Read the last line"))
|
||||
self.assertIn(f'"\\n{ending} ', source)
|
||||
self.assertIn(f"**{ending}**", _section(self.text, "5. Read the result"))
|
||||
self.assertIn(f'title = "{ending}"', source)
|
||||
self.assertNotRegex(self.text, r"Done\. \d+ files")
|
||||
count, size = re.search(r"\n (\d+) files \(([\d.]+ [KMG]B)\)", step3).groups()
|
||||
self.assertIn(f"0/{count} present", step3)
|
||||
@@ -726,15 +727,17 @@ class FirstInstallWalkthrough(unittest.TestCase):
|
||||
self.assertIn(f"all {required} belong", step4)
|
||||
self.assertIn(f"other {total - required} are optional", step4)
|
||||
|
||||
def test_no_platform_detected_reads_like_the_installer(self):
|
||||
source = (ROOT / "install.py").read_text(encoding="utf-8")
|
||||
branch = source.split('print(" No supported platform detected.")', 1)[1][:1600]
|
||||
self.assertIn("if not interactive or listing:", branch)
|
||||
self.assertIn("_prompt_manual_platform(os_type)", branch)
|
||||
def test_nothing_found_reads_like_the_installer(self):
|
||||
# The one-liner hands the terminal to the installer, which opens the
|
||||
# full screen: its first screen says the heading and offers the row.
|
||||
import install
|
||||
|
||||
self.assertIn('"$INSTALLER" "$@" </dev/tty', (ROOT / "install.sh").read_text(encoding="utf-8"))
|
||||
section = _section(self.text, "No supported platform detected.")
|
||||
self.assertIn("a menu follows", section)
|
||||
self.assertIn("--no-input", section)
|
||||
state = install.TuiState()
|
||||
screen = "\n".join(install.tui_view(state, 80, 24))
|
||||
self.assertIn("Nothing was found here.", screen)
|
||||
section = _section(self.text, "Nothing was found here.")
|
||||
self.assertIn(f"**{install.tui_rows(state)[-1].label}**", section)
|
||||
self.assertNotIn("cannot stop and ask", section)
|
||||
|
||||
|
||||
|
||||
@@ -125,15 +125,21 @@ class FirstInstallEnds(unittest.TestCase):
|
||||
"""C7, B15: the page said `Done.` may list failures, and sent a wrong
|
||||
folder to a section with no answer for it."""
|
||||
|
||||
def test_the_wrong_folder_answer_is_dest(self):
|
||||
section = _section(_wiki("first-install.md"), "2. Check the folder it found")
|
||||
self.assertIn("--dest", section)
|
||||
def test_the_wrong_folder_answer_is_on_the_screen(self):
|
||||
# The one-liner opens the full screen: its first screen has the
|
||||
# answer, a row the page names as the interface spells it.
|
||||
import install
|
||||
|
||||
section = _section(_wiki("first-install.md"), "2. Check the setup it found")
|
||||
state = install.TuiState()
|
||||
row = install.tui_rows(state)[-1].label
|
||||
self.assertIn(f"**{row}**", section)
|
||||
self.assertIn("<your setup>", section)
|
||||
self.assertNotIn("Batocera", section)
|
||||
|
||||
def test_the_diagram_follows_the_steps(self):
|
||||
text = _wiki("first-install.md")
|
||||
self.assertLess(text.index("## 5. Read the last line"), text.index("<!-- image: install-flow -->"))
|
||||
self.assertLess(text.index("## 5. Read the result"), text.index("<!-- image: install-flow -->"))
|
||||
|
||||
|
||||
class OneNamePerPage(unittest.TestCase):
|
||||
|
||||
@@ -251,11 +251,21 @@ class SmallCopyFixes(unittest.TestCase):
|
||||
self.assertIn("`retroarch/cores/system/` on the SD card", guides)
|
||||
self.assertIn("--dest E:\\retroarch\\cores\\system", section)
|
||||
|
||||
def test_the_end_line_is_the_printed_one(self):
|
||||
section = _section(_wiki("first-install.md"), "5. Read the last line")
|
||||
self.assertIn("`N files installed, M already up to date.`", section)
|
||||
source = (REPO_ROOT / "install.py").read_text(encoding="utf-8")
|
||||
self.assertIn("installed, \"\n f\"{_plural(up_to_date, 'file')} already up to date.", source)
|
||||
def test_the_end_is_the_shown_one(self):
|
||||
# The one-liner opens the full screen: the page names the titles
|
||||
# its result screen shows, as tui_outcome writes them.
|
||||
import install
|
||||
|
||||
section = _section(_wiki("first-install.md"), "5. Read the result")
|
||||
state = install.TuiState()
|
||||
state.stack, state.code = ["result"], 0
|
||||
for summary in ({"installed": 3, "up_to_date": 0, "failed": []},
|
||||
{"installed": 2, "failed": [{"dest": "a.bin", "reason": "HTTP 404"}]},
|
||||
{"installed": 0, "failed": [{"dest": "a.bin", "reason": "HTTP 404"}]}):
|
||||
state.summary = summary
|
||||
title, _lines = install.tui_outcome(state)
|
||||
with self.subTest(title=title):
|
||||
self.assertIn(f"**{title}**", section)
|
||||
|
||||
|
||||
class CommunityAnswers(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user