From 85a713771b98aca84c900f809b0ccf41d1002d6d Mon Sep 17 00:00:00 2001 From: Aaron Wagener Date: Mon, 18 Nov 2024 11:09:27 -0600 Subject: [PATCH] Tests: have option preset validation test do full validation (#4208) * Tests: have option preset validation test do full validation * sum on an IntFlag is a thing apparently --- test/webhost/test_option_presets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/webhost/test_option_presets.py b/test/webhost/test_option_presets.py index b0af8a87..7105c7f8 100644 --- a/test/webhost/test_option_presets.py +++ b/test/webhost/test_option_presets.py @@ -1,5 +1,6 @@ import unittest +from BaseClasses import PlandoOptions from worlds import AutoWorldRegister from Options import ItemDict, NamedRange, NumericOption, OptionList, OptionSet @@ -14,6 +15,10 @@ class TestOptionPresets(unittest.TestCase): with self.subTest(game=game_name, preset=preset_name, option=option_name): try: option = world_type.options_dataclass.type_hints[option_name].from_any(option_value) + # some options may need verification to ensure the provided option is actually valid + # pass in all plando options in case a preset wants to require certain plando options + # for some reason + option.verify(world_type, "Test Player", PlandoOptions(sum(PlandoOptions))) supported_types = [NumericOption, OptionSet, OptionList, ItemDict] if not any([issubclass(option.__class__, t) for t in supported_types]): self.fail(f"'{option_name}' in preset '{preset_name}' for game '{game_name}' "