Skip to content

Commit

Permalink
Test: option instances have to be pickleable (#4006)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 authored Oct 16, 2024
1 parent 375b579 commit 4882222
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/general/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ def test_item_links_resolve(self):
item_links = {1: ItemLinks.from_any(item_link_group), 2: ItemLinks.from_any(item_link_group)}
for link in item_links.values():
self.assertEqual(link.value[0], item_link_group[0])

def test_pickle_dumps(self):
"""Test options can be pickled into database for WebHost generation"""
import pickle
for gamename, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden:
for option_key, option in world_type.options_dataclass.type_hints.items():
with self.subTest(game=gamename, option=option_key):
pickle.dumps(option(option.default))

0 comments on commit 4882222

Please sign in to comment.