27 lines
972 B
Python
27 lines
972 B
Python
import unittest
|
|
|
|
from BaseClasses import MultiWorld
|
|
from .. import StardewValleyWorld
|
|
from ..items import item_table
|
|
|
|
|
|
class TestItems(unittest.TestCase):
|
|
def test_can_create_item_of_resource_pack(self):
|
|
item_name = "Resource Pack: 500 Money"
|
|
|
|
multi_world = MultiWorld(1)
|
|
multi_world.game[1] = "Stardew Valley"
|
|
multi_world.player_name = {1: "Tester"}
|
|
world = StardewValleyWorld(multi_world, 1)
|
|
item = world.create_item(item_name)
|
|
|
|
assert item.name == item_name
|
|
|
|
def test_items_table_footprint_is_between_717000_and_727000(self):
|
|
item_with_lowest_id = min((item for item in item_table.values() if item.code is not None), key=lambda x: x.code)
|
|
item_with_highest_id = max((item for item in item_table.values() if item.code is not None),
|
|
key=lambda x: x.code)
|
|
|
|
assert item_with_lowest_id.code >= 717000
|
|
assert item_with_highest_id.code < 727000
|