-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from dataclasses import fields | ||
from typing import cast | ||
|
||
from Options import Option | ||
from worlds.AutoWorld import call_all | ||
from worlds.witness import witness_option_groups, TheWitnessOptions | ||
from worlds.witness.test import WitnessTestBase | ||
|
||
_hint_option_groups = {"Hints"} | ||
_hint_options = { | ||
option | ||
for group in witness_option_groups if group.name in _hint_option_groups | ||
for option in group.options | ||
} | ||
_hint_option_names = [ | ||
option.name for option in fields(TheWitnessOptions) | ||
if option.type in _hint_options | ||
and cast(Option, option.type).supports_weighting | ||
] | ||
|
||
|
||
class TestNothingItemsDontCrash(WitnessTestBase): | ||
options = {option_name: "random" for option_name in _hint_option_names} | ||
|
||
def test_nothing_items_dont_crash(self) -> None: | ||
""" | ||
Test that post_fill and fill_slot_data work even if there are Nothing items. | ||
""" | ||
self.assertIsNone(self.world.get_location("Desert Surface 8").item) | ||
for step in ["post_fill", "fill_slot_data"]: | ||
call_all(self.multiworld, step) |