From e8b13621727fc6595e0fa73ab7ed82f40d863f40 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 10 May 2022 19:40:43 +0200 Subject: [PATCH] Test: check for working completion condition --- test/general/TestImplemented.py | 14 ++++++++++++++ test/general/__init__.py | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 test/general/TestImplemented.py diff --git a/test/general/TestImplemented.py b/test/general/TestImplemented.py new file mode 100644 index 00000000..235eafdb --- /dev/null +++ b/test/general/TestImplemented.py @@ -0,0 +1,14 @@ +import unittest +from worlds.AutoWorld import AutoWorldRegister, World + +from . import setup_default_world + + +class TestIDs(unittest.TestCase): + def testCompletionCondition(self): + """Ensure a completion condition is set that has requirements.""" + for gamename, world_type in AutoWorldRegister.world_types.items(): + if not world_type.hidden and gamename not in {"ArchipIDLE", "Final Fantasy"}: + with self.subTest(gamename): + world = setup_default_world(world_type) + self.assertFalse(world.completion_condition[1](world.state)) diff --git a/test/general/__init__.py b/test/general/__init__.py index c59af4d4..8b966c0e 100644 --- a/test/general/__init__.py +++ b/test/general/__init__.py @@ -1,12 +1,12 @@ from argparse import Namespace -from BaseClasses import MultiWorld, CollectionState +from BaseClasses import MultiWorld from worlds.AutoWorld import call_all gen_steps = ["generate_early", "create_regions", "create_items", "set_rules", "generate_basic", "pre_fill"] -def setup_default_world(world_type): +def setup_default_world(world_type) -> MultiWorld: world = MultiWorld(1) world.game[1] = world_type.game world.player_name = {1: "Tester"}