Files
Grinch-AP/worlds/sc2/test/test_location_groups.py
Ziktofel 5f1835c546 SC2: Content update (#5312)
Feature highlights:
- Adds many content to the SC2 game
- Allows custom mission order
- Adds race-swapped missions for build missions (except Epilogue and NCO)
- Allows War Council Nerfs (Protoss units can get pre - War Council State, alternative units get another custom nerf to match the power level of base units)
- Revamps Predator's upgrade tree (never was considered strategically important)
- Adds some units and upgrades
- Locked and excluded items can specify quantity
- Key mode (if opt-in, missions require keys to be unlocked on top of their regular regular requirements
- Victory caches - Victory locations can grant multiple items to the multiworld instead of one 
- The generator is more resilient for generator failures as it validates logic for item excludes
- Fixes the following issues:
  - https://github.com/ArchipelagoMW/Archipelago/issues/3531 
  - https://github.com/ArchipelagoMW/Archipelago/issues/3548
2025-09-02 17:40:58 +02:00

38 lines
2.4 KiB
Python

import unittest
from .. import location_groups
from ..mission_tables import SC2Mission, MissionFlag
class TestLocationGroups(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.location_groups = location_groups.get_location_groups()
def test_location_categories_have_a_group(self) -> None:
self.assertIn('Victory', self.location_groups)
self.assertIn(f'{SC2Mission.LIBERATION_DAY.mission_name}: Victory', self.location_groups['Victory'])
self.assertIn(f'{SC2Mission.IN_UTTER_DARKNESS.mission_name}: Defeat', self.location_groups['Victory'])
self.assertIn('Vanilla', self.location_groups)
self.assertIn(f'{SC2Mission.WELCOME_TO_THE_JUNGLE.mission_name}: Close Relic', self.location_groups['Vanilla'])
self.assertIn('Extra', self.location_groups)
self.assertIn(f'{SC2Mission.SMASH_AND_GRAB.mission_name}: First Forcefield Area Busted', self.location_groups['Extra'])
self.assertIn('Challenge', self.location_groups)
self.assertIn(f'{SC2Mission.ZERO_HOUR.mission_name}: First Hatchery', self.location_groups['Challenge'])
self.assertIn('Mastery', self.location_groups)
self.assertIn(f'{SC2Mission.WELCOME_TO_THE_JUNGLE.mission_name}: Protoss Cleared', self.location_groups['Mastery'])
def test_missions_have_a_group(self) -> None:
self.assertIn(SC2Mission.LIBERATION_DAY.mission_name, self.location_groups)
self.assertIn(f'{SC2Mission.LIBERATION_DAY.mission_name}: Victory', self.location_groups[SC2Mission.LIBERATION_DAY.mission_name])
self.assertIn(f'{SC2Mission.LIBERATION_DAY.mission_name}: Special Delivery', self.location_groups[SC2Mission.LIBERATION_DAY.mission_name])
def test_race_swapped_locations_share_a_group(self) -> None:
self.assertIn(MissionFlag.HasRaceSwap, SC2Mission.ZERO_HOUR.flags)
ZERO_HOUR = 'Zero Hour'
self.assertNotEqual(ZERO_HOUR, SC2Mission.ZERO_HOUR.mission_name)
self.assertIn(ZERO_HOUR, self.location_groups)
self.assertIn(f'{ZERO_HOUR}: Victory', self.location_groups)
self.assertIn(f'{SC2Mission.ZERO_HOUR.mission_name}: Victory', self.location_groups[f'{ZERO_HOUR}: Victory'])
self.assertIn(f'{SC2Mission.ZERO_HOUR_P.mission_name}: Victory', self.location_groups[f'{ZERO_HOUR}: Victory'])
self.assertIn(f'{SC2Mission.ZERO_HOUR_Z.mission_name}: Victory', self.location_groups[f'{ZERO_HOUR}: Victory'])