2023-04-10 02:33:47 +00:00
|
|
|
import unittest
|
|
|
|
from worlds.AutoWorld import AutoWorldRegister
|
|
|
|
|
|
|
|
|
|
|
|
class TestOptions(unittest.TestCase):
|
2023-10-22 11:00:27 +00:00
|
|
|
def test_options_have_doc_string(self):
|
|
|
|
"""Test that submitted options have their own specified docstring"""
|
2023-04-10 02:33:47 +00:00
|
|
|
for gamename, world_type in AutoWorldRegister.world_types.items():
|
|
|
|
if not world_type.hidden:
|
2023-10-10 20:30:20 +00:00
|
|
|
for option_key, option in world_type.options_dataclass.type_hints.items():
|
2023-04-10 02:33:47 +00:00
|
|
|
with self.subTest(game=gamename, option=option_key):
|
|
|
|
self.assertTrue(option.__doc__)
|
2024-01-15 19:50:16 +00:00
|
|
|
|
|
|
|
def test_options_are_not_set_by_world(self):
|
|
|
|
"""Test that options attribute is not already set"""
|
|
|
|
for gamename, world_type in AutoWorldRegister.world_types.items():
|
|
|
|
with self.subTest(game=gamename):
|
|
|
|
self.assertFalse(hasattr(world_type, "options"),
|
|
|
|
f"Unexpected assignment to {world_type.__name__}.options!")
|