2025-05-10 17:57:24 -04:00
|
|
|
from Options import PerGameCommonOptions, OptionSet, OptionDict
|
2024-12-08 21:00:30 -05:00
|
|
|
from .. import SVTestCase
|
2025-05-10 17:57:24 -04:00
|
|
|
from ...options import StardewValleyOptions, TrapItems
|
2024-12-08 21:00:30 -05:00
|
|
|
from ...options.presets import sv_options_presets
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
|
|
|
|
class TestPresets(SVTestCase):
|
|
|
|
def test_all_presets_explicitly_set_all_options(self):
|
|
|
|
all_option_names = {option_key for option_key in StardewValleyOptions.type_hints}
|
2025-05-10 17:57:24 -04:00
|
|
|
omitted_option_names = {option_key for option_key in PerGameCommonOptions.type_hints} | {TrapItems.internal_name}
|
2024-03-15 15:05:14 +03:00
|
|
|
mandatory_option_names = {option_key for option_key in all_option_names
|
|
|
|
if option_key not in omitted_option_names and
|
2025-05-10 17:57:24 -04:00
|
|
|
not issubclass(StardewValleyOptions.type_hints[option_key], OptionSet | OptionDict)}
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
for preset_name in sv_options_presets:
|
|
|
|
with self.subTest(f"{preset_name}"):
|
|
|
|
for option_name in mandatory_option_names:
|
|
|
|
with self.subTest(f"{preset_name} -> {option_name}"):
|
2024-12-08 21:00:30 -05:00
|
|
|
self.assertIn(option_name, sv_options_presets[preset_name])
|