def setup(self):
        self.floor_rock = 1
        self.wall_empty = None
        self.rng = Random()
        self.level = (LevelBuilder()
                      .with_size((60, 40))
                      .with_floor_tile(self.floor_rock)
                      .with_wall_tile(self.wall_empty)
                      .build())
        add_location_tag(self.level, (10, 10), 'room')

        for x_loc in range(11, 30):
            add_location_tag(self.level, (x_loc, 10), 'corridor')

        item_config = ItemConfigurations(Random())

        item_config.add_item(
                    ItemConfiguration(name = 'dagger',
                                      cost = 2,
                                      weight = 1,
                                      icons = [500],
                                      types = ['weapon',
                                               'light weapon',
                                               'melee',
                                               'simple weapon'],
                                      rarity = 'common',
                                      weapon_configration = WeaponConfiguration(
                                            damage = [(2, 'piercing'),
                                                      (2, 'slashing')],
                                            critical_range = 11,
                                            critical_damage = 2,
                                            weapon_class = 'simple')))

        item_config.add_item(
                    ItemConfiguration(name = 'red potion',
                                      cost = 150,
                                      weight = 1,
                                      icons = [100],
                                      types = ['potion'],
                                      rarity = 'rare',
                                      effect_handles = [EffectHandle(
                                            trigger = 'on drink',
                                            effect = 'cure medium wounds',
                                            parameters = None,
                                            charges = 1)]))

        self.item_generator = ItemGenerator(item_config)

        self.configuration = [item_by_name(3, 4, 'dagger'),
                              item_by_type(1, 1, 'potion')]

        self.item_adder = ItemAdder(self.item_generator,
                                    self.configuration,
                                    self.rng)

        self.item_adder.add_items(self.level)
Setup the test case
dataset/ETHPy150Open tuturto/pyherc/src/pyherc/test/unit/test_itemadder.py/ItemAdder.setup