Files
Grinch-AP/worlds/kh2/test/TestSlotData.py
JaredWeakStrike 06a25a903e KH2: New Unit Test and better keyblade fill (#1744)
__init__:
 - Added exception for if the player has too many excluded abilities on keyblades.
 - Fixed Action Abilities only on keyblades from breaking.
 - Added proper support for ability quantity's instead of 1 of the ability 
 - Moved filling the localitems slot data to init instead of generate_output so I could easily unit test it

TestSlotData:
- Checks if the "localItems" part of slot data is filled. This is used for keeping track of local items and making sure nothing dupes
2023-04-23 22:20:43 +02:00

22 lines
916 B
Python

import unittest
from test.general import setup_solo_multiworld
from . import KH2TestBase
from .. import KH2World, all_locations, item_dictionary_table, CheckDupingItems, AllWeaponSlot, KH2Item
from ..Names import ItemName
from ... import AutoWorldRegister
from ...AutoWorld import call_all
class TestLocalItems(KH2TestBase):
def testSlotData(self):
gen_steps = ("generate_early", "create_regions", "create_items", "set_rules", "generate_basic", "pre_fill")
multiworld = setup_solo_multiworld(KH2World, gen_steps)
for location in multiworld.get_locations():
if location.item is None:
location.place_locked_item(multiworld.worlds[1].create_item(ItemName.NoExperience))
call_all(multiworld, "fill_slot_data")
slotdata = multiworld.worlds[1].fill_slot_data()
assert len(slotdata["LocalItems"]) > 0, f"{slotdata['LocalItems']} is empty"