From aa72f671bc7a0690200476b0630afd9e06279207 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sun, 21 Jan 2024 19:34:24 +0100 Subject: [PATCH] SoE: fix naming of atlas medallion (#2747) In pyevermizer, it's called Atlas Medallion, not Amulet, leading to an empty group and to code not considering them as an alchemy ingredient when swapping out for a trap or an energy core fragment. Also adds a test. --- worlds/soe/__init__.py | 2 +- worlds/soe/test/test_item_mapping.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 worlds/soe/test/test_item_mapping.py diff --git a/worlds/soe/__init__.py b/worlds/soe/__init__.py index 74387fb1be80..bbe018da5329 100644 --- a/worlds/soe/__init__.py +++ b/worlds/soe/__init__.py @@ -81,7 +81,7 @@ # item helpers _ingredients = ( 'Wax', 'Water', 'Vinegar', 'Root', 'Oil', 'Mushroom', 'Mud Pepper', 'Meteorite', 'Limestone', 'Iron', - 'Gunpowder', 'Grease', 'Feather', 'Ethanol', 'Dry Ice', 'Crystal', 'Clay', 'Brimstone', 'Bone', 'Atlas Amulet', + 'Gunpowder', 'Grease', 'Feather', 'Ethanol', 'Dry Ice', 'Crystal', 'Clay', 'Brimstone', 'Bone', 'Atlas Medallion', 'Ash', 'Acorn' ) _other_items = ( diff --git a/worlds/soe/test/test_item_mapping.py b/worlds/soe/test/test_item_mapping.py new file mode 100644 index 000000000000..7df05837c78b --- /dev/null +++ b/worlds/soe/test/test_item_mapping.py @@ -0,0 +1,21 @@ +from unittest import TestCase +from .. import SoEWorld + + +class TestMapping(TestCase): + def test_atlas_medallion_name_group(self) -> None: + """ + Test that we used the pyevermizer name for Atlas Medallion (not Amulet) in item groups. + """ + self.assertIn("Any Atlas Medallion", SoEWorld.item_name_groups) + + def test_atlas_medallion_name_items(self) -> None: + """ + Test that we used the pyevermizer name for Atlas Medallion (not Amulet) in items. + """ + found_medallion = False + for name in SoEWorld.item_name_to_id: + self.assertNotIn("Atlas Amulet", name, "Expected Atlas Medallion, not Amulet") + if "Atlas Medallion" in name: + found_medallion = True + self.assertTrue(found_medallion, "Did not find Atlas Medallion in items")