def player(): new_map = toolkit.test_map() return new_map.player
def test_map(): return toolkit.test_map()
def test_blocking_entity(test_player): testmap = toolkit.test_map() testmap.place(test_player, 1, 2) # Blocked by a wall, not an entity a = ActionWithDirection(entity=test_player, dx=0, dy=-1) assert not a.blocking_entity
def test_target_actor(test_player): testmap = toolkit.test_map() testmap.place(test_player, 2, 4) a = ActionWithDirection(entity=test_player, dx=0, dy=1) assert a.target_actor.name == "grid bug"
def player(): m = toolkit.test_map() player = m.player dagger = player.inventory.item_dict.get('a') assert player.equipment.toggle_equip(dagger) return player