1
1
import unittest
2
+
3
+ from BaseClasses import PlandoOptions
4
+ from Options import ItemLinks
2
5
from worlds .AutoWorld import AutoWorldRegister
3
6
4
7
@@ -17,3 +20,30 @@ def test_options_are_not_set_by_world(self):
17
20
with self .subTest (game = gamename ):
18
21
self .assertFalse (hasattr (world_type , "options" ),
19
22
f"Unexpected assignment to { world_type .__name__ } .options!" )
23
+
24
+ def test_item_links_name_groups (self ):
25
+ """Tests that item links successfully unfold item_name_groups"""
26
+ item_link_groups = [
27
+ [{
28
+ "name" : "ItemLinkGroup" ,
29
+ "item_pool" : ["Everything" ],
30
+ "link_replacement" : False ,
31
+ "replacement_item" : None ,
32
+ }],
33
+ [{
34
+ "name" : "ItemLinkGroup" ,
35
+ "item_pool" : ["Hammer" , "Bow" ],
36
+ "link_replacement" : False ,
37
+ "replacement_item" : None ,
38
+ }]
39
+ ]
40
+ # we really need some sort of test world but generic doesn't have enough items for this
41
+ world = AutoWorldRegister .world_types ["A Link to the Past" ]
42
+ plando_options = PlandoOptions .from_option_string ("bosses" )
43
+ item_links = [ItemLinks .from_any (item_link_groups [0 ]), ItemLinks .from_any (item_link_groups [1 ])]
44
+ for link in item_links :
45
+ link .verify (world , "tester" , plando_options )
46
+ self .assertIn ("Hammer" , link .value [0 ]["item_pool" ])
47
+ self .assertIn ("Bow" , link .value [0 ]["item_pool" ])
48
+
49
+ # TODO test that the group created using these options has the items
0 commit comments