From 1e2125d4204c709ba8fb658018b473753c11193b Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Fri, 9 Aug 2024 01:24:56 +0200 Subject: [PATCH] Make the unit test worse (lol) --- worlds/witness/test/test_misc.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 worlds/witness/test/test_misc.py diff --git a/worlds/witness/test/test_misc.py b/worlds/witness/test/test_misc.py new file mode 100644 index 000000000000..9e638d1a3a4f --- /dev/null +++ b/worlds/witness/test/test_misc.py @@ -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)