Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: test that item/location name groups are not empty #2748

Merged
merged 4 commits into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions test/general/test_groups.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from unittest import TestCase

from worlds.AutoWorld import AutoWorldRegister


class TestNameGroups(TestCase):
def test_item_name_groups_not_empty(self) -> None:
"""
Test that there are no empty item name groups, which is likely a bug.
"""
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.item_id_to_name:
continue # ignore worlds without items
with self.subTest(game=game_name):
for name, group in world_type.item_name_groups.items():
self.assertTrue(group, f"Item name group \"{name}\" of \"{game_name}\" is empty")

def test_location_name_groups_not_empty(self) -> None:
"""
Test that there are no empty location name groups, which is likely a bug.
"""
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.location_id_to_name:
continue # ignore worlds without locations
with self.subTest(game=game_name):
for name, group in world_type.location_name_groups.items():
self.assertTrue(group, f"Location name group \"{name}\" of \"{game_name}\" is empty")
Loading