From 1e414dd370d223465e3f77c768060678c6a3b1b9 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 8 Jun 2021 22:14:56 +0200 Subject: [PATCH] fix tests --- Options.py | 2 +- test/dungeons/TestDungeon.py | 3 +++ test/hollow_knight/__init__.py | 4 +++- test/inverted/TestInverted.py | 4 +++- test/inverted_minor_glitches/TestInvertedMinor.py | 4 +++- test/inverted_owg/TestInvertedOWG.py | 3 +++ test/minor_glitches/TestMinor.py | 4 +++- test/owg/TestVanillaOWG.py | 3 +++ test/vanilla/TestVanilla.py | 4 +++- 9 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Options.py b/Options.py index 92213f96..b0bdb767 100644 --- a/Options.py +++ b/Options.py @@ -215,7 +215,7 @@ class Crystals(Range): class CrystalsTower(Crystals): - pass + default = 7 class CrystalsGanon(Crystals): diff --git a/test/dungeons/TestDungeon.py b/test/dungeons/TestDungeon.py index ea8a87ae..7483009d 100644 --- a/test/dungeons/TestDungeon.py +++ b/test/dungeons/TestDungeon.py @@ -8,11 +8,14 @@ from worlds.alttp.Items import ItemFactory from worlds.alttp.Regions import create_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules +from Options import alttp_options class TestDungeon(unittest.TestCase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.starting_regions = [] # Where to start exploring self.remove_exits = [] # Block dungeon exits self.world.difficulty_requirements[1] = difficulties['normal'] diff --git a/test/hollow_knight/__init__.py b/test/hollow_knight/__init__.py index 63212fdf..39a155d0 100644 --- a/test/hollow_knight/__init__.py +++ b/test/hollow_knight/__init__.py @@ -11,6 +11,8 @@ class TestVanilla(TestBase): self.world.game[1] = "Hollow Knight" import Options for hk_option in Options.hollow_knight_randomize_options: - getattr(self.world, hk_option)[1] = True + setattr(self.world, hk_option, {1: True}) + for hk_option, option in Options.hollow_knight_skip_options.items(): + setattr(self.world, hk_option, {1: option.default}) create_regions(self.world, 1) gen_hollow(self.world, 1) \ No newline at end of file diff --git a/test/inverted/TestInverted.py b/test/inverted/TestInverted.py index 08f3c8cd..f3a716cc 100644 --- a/test/inverted/TestInverted.py +++ b/test/inverted/TestInverted.py @@ -8,11 +8,13 @@ from worlds.alttp.Regions import mark_light_world_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules from test.TestBase import TestBase - +from Options import alttp_options class TestInverted(TestBase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.world.difficulty_requirements[1] = difficulties['normal'] self.world.mode[1] = "inverted" create_inverted_regions(self.world, 1) diff --git a/test/inverted_minor_glitches/TestInvertedMinor.py b/test/inverted_minor_glitches/TestInvertedMinor.py index e28d18c2..41e93c6e 100644 --- a/test/inverted_minor_glitches/TestInvertedMinor.py +++ b/test/inverted_minor_glitches/TestInvertedMinor.py @@ -8,11 +8,13 @@ from worlds.alttp.Regions import mark_light_world_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules from test.TestBase import TestBase - +from Options import alttp_options class TestInvertedMinor(TestBase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.world.mode[1] = "inverted" self.world.logic[1] = "minorglitches" self.world.difficulty_requirements[1] = difficulties['normal'] diff --git a/test/inverted_owg/TestInvertedOWG.py b/test/inverted_owg/TestInvertedOWG.py index 5dd3fa6e..1a2c377a 100644 --- a/test/inverted_owg/TestInvertedOWG.py +++ b/test/inverted_owg/TestInvertedOWG.py @@ -8,11 +8,14 @@ from worlds.alttp.Regions import mark_light_world_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules from test.TestBase import TestBase +from Options import alttp_options class TestInvertedOWG(TestBase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.world.logic[1] = "owglitches" self.world.mode[1] = "inverted" self.world.difficulty_requirements[1] = difficulties['normal'] diff --git a/test/minor_glitches/TestMinor.py b/test/minor_glitches/TestMinor.py index c7efa5ff..b573bac1 100644 --- a/test/minor_glitches/TestMinor.py +++ b/test/minor_glitches/TestMinor.py @@ -8,11 +8,13 @@ from worlds.alttp.Regions import create_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules from test.TestBase import TestBase - +from Options import alttp_options class TestMinor(TestBase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.world.logic[1] = "minorglitches" self.world.difficulty_requirements[1] = difficulties['normal'] create_regions(self.world, 1) diff --git a/test/owg/TestVanillaOWG.py b/test/owg/TestVanillaOWG.py index 824d72f8..a4082b31 100644 --- a/test/owg/TestVanillaOWG.py +++ b/test/owg/TestVanillaOWG.py @@ -8,11 +8,14 @@ from worlds.alttp.Regions import create_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules from test.TestBase import TestBase +from Options import alttp_options class TestVanillaOWG(TestBase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.world.difficulty_requirements[1] = difficulties['normal'] self.world.logic[1] = "owglitches" create_regions(self.world, 1) diff --git a/test/vanilla/TestVanilla.py b/test/vanilla/TestVanilla.py index a5d53e1b..5e1dde2b 100644 --- a/test/vanilla/TestVanilla.py +++ b/test/vanilla/TestVanilla.py @@ -8,11 +8,13 @@ from worlds.alttp.Regions import create_regions from worlds.alttp.Shops import create_shops from worlds.alttp.Rules import set_rules from test.TestBase import TestBase - +from Options import alttp_options class TestVanilla(TestBase): def setUp(self): self.world = MultiWorld(1) + for option_name, option in alttp_options.items(): + setattr(self.world, option_name, {1: option.default}) self.world.logic[1] = "noglitches" self.world.difficulty_requirements[1] = difficulties['normal'] create_regions(self.world, 1)