mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-07 15:13:52 -08:00
Tests: test that every option in a preset is visible in either simple or complex UI (#5750)
This commit is contained in:
@@ -2,7 +2,7 @@ import unittest
|
|||||||
|
|
||||||
from BaseClasses import PlandoOptions
|
from BaseClasses import PlandoOptions
|
||||||
from worlds import AutoWorldRegister
|
from worlds import AutoWorldRegister
|
||||||
from Options import OptionCounter, NamedRange, NumericOption, OptionList, OptionSet
|
from Options import OptionCounter, NamedRange, NumericOption, OptionList, OptionSet, Visibility
|
||||||
|
|
||||||
|
|
||||||
class TestOptionPresets(unittest.TestCase):
|
class TestOptionPresets(unittest.TestCase):
|
||||||
@@ -19,6 +19,9 @@ class TestOptionPresets(unittest.TestCase):
|
|||||||
# pass in all plando options in case a preset wants to require certain plando options
|
# pass in all plando options in case a preset wants to require certain plando options
|
||||||
# for some reason
|
# for some reason
|
||||||
option.verify(world_type, "Test Player", PlandoOptions(sum(PlandoOptions)))
|
option.verify(world_type, "Test Player", PlandoOptions(sum(PlandoOptions)))
|
||||||
|
if not (Visibility.complex_ui in option.visibility or Visibility.simple_ui in option.visibility):
|
||||||
|
self.fail(f"'{option_name}' in preset '{preset_name}' for game '{game_name}' is not "
|
||||||
|
f"visible in any supported UI.")
|
||||||
supported_types = [NumericOption, OptionSet, OptionList, OptionCounter]
|
supported_types = [NumericOption, OptionSet, OptionList, OptionCounter]
|
||||||
if not any([issubclass(option.__class__, t) for t in supported_types]):
|
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}' "
|
self.fail(f"'{option_name}' in preset '{preset_name}' for game '{game_name}' "
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ all_random = {
|
|||||||
"game_language": "random",
|
"game_language": "random",
|
||||||
"goal": "random",
|
"goal": "random",
|
||||||
"goal_speed": "random",
|
"goal_speed": "random",
|
||||||
"total_heart_stars": "random",
|
"max_heart_stars": "random",
|
||||||
"heart_stars_required": "random",
|
"heart_stars_required": "random",
|
||||||
"filler_percentage": "random",
|
"filler_percentage": "random",
|
||||||
"trap_percentage": "random",
|
"trap_percentage": "random",
|
||||||
@@ -34,7 +34,7 @@ all_random = {
|
|||||||
beginner = {
|
beginner = {
|
||||||
"goal": "zero",
|
"goal": "zero",
|
||||||
"goal_speed": "normal",
|
"goal_speed": "normal",
|
||||||
"total_heart_stars": 50,
|
"max_heart_stars": 50,
|
||||||
"heart_stars_required": 30,
|
"heart_stars_required": 30,
|
||||||
"filler_percentage": 25,
|
"filler_percentage": 25,
|
||||||
"trap_percentage": 0,
|
"trap_percentage": 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user