mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Test: introduce test for every game has a tutorial (#478)
This commit is contained in:
22
test/webhost/TestTutorial.py
Normal file
22
test/webhost/TestTutorial.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
from worlds.AutoWorld import AutoWorldRegister
|
||||
|
||||
|
||||
class TestBase(unittest.TestCase):
|
||||
def testCreateItem(self):
|
||||
import WebHost
|
||||
tutorials_data = WebHost.create_ordered_tutorials_file()
|
||||
games_with_tutorial = set(entry["gameTitle"] for entry in tutorials_data)
|
||||
for game_name, world_type in AutoWorldRegister.world_types.items():
|
||||
if not world_type.hidden:
|
||||
with self.subTest(game_name):
|
||||
try:
|
||||
self.assertIn(game_name, games_with_tutorial)
|
||||
except AssertionError:
|
||||
# look for partial name in the tutorial name
|
||||
for game in games_with_tutorial:
|
||||
if game_name in game:
|
||||
break
|
||||
else:
|
||||
self.fail(f"{game_name} has no setup tutorial. "
|
||||
f"Games with Tutorial: {games_with_tutorial}")
|
0
test/webhost/__init__.py
Normal file
0
test/webhost/__init__.py
Normal file
Reference in New Issue
Block a user