Files
Grinch-AP/worlds/zillion/test/TestOptions.py
black-sliver 5882ce7380 Various worlds: Fix more absolute world imports (#3510)
* Adventure: remove absolute imports

* Alttp: remove absolute imports (all but tests)

* Aquaria: remove absolute imports in tests

running tests from apworld may fail (on 3.8 and maybe in the future) otherwise

* DKC3: remove absolute imports

* LADX: remove absolute imports

* Overcooked 2: remove absolute imports in tests

running tests from apworld may fail otherwise

* Rogue Legacy: remove absolute imports in tests

running tests from apworld may fail otherwise

* SC2: remove absolute imports

* SMW: remove absolute imports

* Subnautica: remove absolute imports in tests

running tests from apworld may fail otherwise

* Zillion: remove absolute imports in tests

running tests from apworld may fail otherwise
2024-06-27 08:51:27 +02:00

31 lines
1.1 KiB
Python

from . import ZillionTestBase
from ..options import ZillionJumpLevels, ZillionGunLevels, ZillionOptions, validate
from zilliandomizer.options import VBLR_CHOICES
class OptionsTest(ZillionTestBase):
auto_construct = False
def test_validate_default(self) -> None:
self.world_setup()
options = self.multiworld.worlds[1].options
assert isinstance(options, ZillionOptions)
validate(options)
def test_vblr_ap_to_zz(self) -> None:
""" all of the valid values for the AP options map to valid values for ZZ options """
for option_name, vblr_class in (
("jump_levels", ZillionJumpLevels),
("gun_levels", ZillionGunLevels)
):
for value in vblr_class.name_lookup.values():
self.options = {option_name: value}
self.world_setup()
options = self.multiworld.worlds[1].options
assert isinstance(options, ZillionOptions)
zz_options, _item_counts = validate(options)
assert getattr(zz_options, option_name) in VBLR_CHOICES
# TODO: test validate with invalid combinations of options