예제 #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"
예제 #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"
예제 #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"
예제 #4
0
def test_look_object_at_floor_item():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("amulet") == "Pretty amulet"
예제 #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"
예제 #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"
예제 #7
0
def test_basic_look_enemy():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("enemy1") == "Description e1"
예제 #8
0
def test_look_far_place_test():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("town") == "Cannot look at town"
예제 #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"
예제 #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."
예제 #11
0
def test_look_nonexistent():
    game = Game()
    game.load("games/LookTest.xml")
    assert game.look_at("nonexistent") == "Cannot look at nonexistent"
예제 #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"