예제 #1
0
def test_that_player_can_exit(p1, test_room):
    level = test_room.enter(p1, "exit")
    assert level.exit(p1)
예제 #2
0
def test_that_player_cannot_exit_from_entrance(p1, test_room):
    level = test_room.enter(p1, "entrance")
    assert not level.exit(p1)
예제 #3
0
def test_that_player_can_move_west(p1, test_room):
    level = test_room.enter(p1, "entrance")
    p1.travel("w")
    coords = p1.locate()
    assert 4 == coords[0]
    assert 6 == coords[1]
예제 #4
0
def test_that_player_can_move_south(p1, test_room):
    level = test_room.enter(p1, "entrance")
    p1.travel("s")
    coords = p1.locate()
    assert 5 == coords[0]
    assert 5 == coords[1]
예제 #5
0
def test_that_player_enters_at_location(p1, test_room):
    level = test_room.enter(p1, "exit")
    player = level.get_by_name("player")
    coords = player.locate()
    assert 3 == coords[0]
    assert 12 == coords[1]
예제 #6
0
def test_that_player_can_be_located(p1, test_room):
    level = test_room.enter(p1, "entrance")
    player = level.get_by_name("player")
    coords = player.locate()
    assert 5 == coords[0]
    assert 6 == coords[1]
예제 #7
0
def test_that_player_can_enter_room(p1, test_room):
    assert not p1.in_room()
    level = test_room.enter(p1, "entrance")
    assert p1.in_room()