Exemplo n.º 1
0
def test_look_object_switch_equipped_weapon():
    game = Game()
    game.load("games/LookTest.xml")
    game.pickup("sword")
    game.pickup("sword2")
    game.equip("sword")
    assert game.look_at("sword") == "Just a lousy sword. You have it equipped"
    assert game.look_at("sword2") == "Another sword"
    game.equip("sword2")
    assert game.look_at("sword") == "Just a lousy sword"
    assert game.look_at("sword2") == "Another sword. You have it equipped"
Exemplo n.º 2
0
def test_look_object_equipped_shield():
    game = Game()
    game.load("games/LookTest.xml")
    game.pickup("shield")
    game.equip("shield")
    assert game.look_at(
        "shield") == "Just a lousy shield. You have it equipped"
Exemplo n.º 3
0
def test_look_object_in_backpack():
    game = Game()
    game.load("games/LookTest.xml")
    game.pickup("sword")
    assert game.look_at("sword") == "Just a lousy sword"
Exemplo n.º 4
0
def test_look_object_at_floor_item():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("amulet") == "Pretty amulet"
Exemplo n.º 5
0
def test_look_object_at_floor_shield():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("shield") == "Just a lousy shield"
Exemplo n.º 6
0
def test_look_object_at_floor_weapon():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("sword") == "Just a lousy sword"
Exemplo n.º 7
0
def test_basic_look_enemy():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("enemy1") == "Description e1"
Exemplo n.º 8
0
def test_look_far_place_test():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("town") == "Cannot look at town"
Exemplo n.º 9
0
def test_look_next_place_test():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("sea") == "You can see the sea from here"
Exemplo n.º 10
0
def test_basic_look_place_test():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("forest") == "It is a nice forest."
Exemplo n.º 11
0
def test_look_nonexistent():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("nonexistent") == "Cannot look at nonexistent"
Exemplo n.º 12
0
def test_look_object_not_equipped_amulet():
    game = Game()
    game.load("games/LookTest.xml")
    game.pickup("amulet")
    game.equip("amulet")
    assert game.look_at("amulet") == "Pretty amulet"