Skip to content

Commit

Permalink
Make the unit test worse (lol)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Aug 8, 2024
1 parent 4dbfaac commit 1e2125d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions worlds/witness/test/test_misc.py
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)

0 comments on commit 1e2125d

Please sign in to comment.