From 5b37fb5986e7801f255f76917c9619cb7d2eeb1a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 07:28:26 +0000 Subject: [PATCH] Pin the launcher's default settings in a test: updates checked at start, hidden while playing, build cache kept, Stable. These were already the defaults of a new install and of Default Settings; the test keeps a later change from turning one of them off unnoticed, and checks that a player's own choices still stay. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BSHQpLnScF9sNv4LNAaaS3 --- tests/launcher_test.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/launcher_test.py b/tests/launcher_test.py index f7ab55b6..af32e20a 100644 --- a/tests/launcher_test.py +++ b/tests/launcher_test.py @@ -263,6 +263,20 @@ class SettingsTest(Tmp): t.reset() self.assertEqual((t['auto_check'], t['game_dir'], t['channel']), (True, 'D:/g', 'stable')) + def test_defaults(self): + # the Settings page of a new install, and what Default Settings goes back to: updates checked at start, the + # launcher hidden while playing, the build cache kept (an update recompiles only what changed), Stable + chosen = ('auto_check', 'hide_while_playing', 'keep_cache', 'channel') + want = (True, True, True, 'stable') + s = settings.Settings(self.layout.settings) + self.assertEqual(tuple(s[k] for k in chosen), want) + s.update(auto_check=False, hide_while_playing=False, keep_cache=False, channel='preview') + s.save() + t = settings.Settings(self.layout.settings) # a player's own choices stay across starts and updates + self.assertEqual(tuple(t[k] for k in chosen), (False, False, False, 'preview')) + t.reset() + self.assertEqual(tuple(t[k] for k in chosen), want) + def test_bad_types_ignored(self): self.layout.settings.write_text(json.dumps({'auto_check': 'yes', 'channel': 'preview', 'junk': 1})) s = settings.Settings(self.layout.settings)