def test_search_place_full(): game = Game() game.load("games/SearchTest.xml") message = "You found a sword\n" \ + "You found a amulet\n" \ + "You found a shield\n" assert game.search("Forest") == message
def test_search_basic(): game = Game() game.load("games/SearchTest.xml") message = "You found a sword\n" \ + "You found a amulet\n" \ + "You found a shield\n" assert game.search() == message
def test_reequip_shield(): game = Game() game.load("games/EquipTest.xml") game.pickup("shield+1") game.pickup("shield+2") game.equip("shield+1") assert game.equip("shield+2") == "You equipped your shield+2" message = "You look in your backpack:" \ + "\n\tYou have a shield+1" assert game.search("backpack") == message
def test_search_backpack_full(): game = Game() game.load("games/SearchTest.xml") game.pickup("sword") game.pickup("amulet") game.pickup("shield") message = "You look in your backpack:" \ + "\n\tYou have a sword" \ + "\n\tYou have a amulet" \ + "\n\tYou have a shield" assert game.search("backpack") == message
def test_search_nonexistent(): game = Game() game.load("games/SearchTest.xml") assert game.search("nonexistent") == "Cannot search nonexistent"
def test_search_backpack_emptied(): game = Game() game.load("games/SearchTest.xml") game.pickup("sword") game.equip("sword") assert game.search("backpack") == "You look in your backpack:"
def test_search_backpack_empty(): game = Game() game.load("games/SearchTest.xml") assert game.search("backpack") == "You look in your backpack:"
def test_search_dead_enemy2(): game = Game() game.load("games/SearchTest.xml") game.fight("Enemy2") assert game.search("Enemy2") == "Found nothing in Enemy2"
def test_search_dead_enemy1(): game = Game() game.load("games/SearchTest.xml") game.fight("Enemy1") assert game.search("Enemy1") == "You found a ring\n"
def test_search_alive_enemy(): game = Game() game.load("games/SearchTest.xml") assert game.search( "Enemy1") == "You cannot search Enemy1 while it is alive!"
def test_search_place_empty(): game = Game() game.load("games/SearchTest.xml") game.goto("sea") assert game.search() == "Found nothing"