Exemplo n.º 1
0
def test_move_valid_2():

    player = Player(TestWorldEmpty)
    player.up()
    player.right()

    assert player.position == (2, 0)
Exemplo n.º 2
0
def test_step_record():

    player = Player(TestWorldStarts)

    player.down()
    player.right()
    player.up()

    assert player.step_record == [Player.DOWN, Player.RIGHT, Player.UP]
Exemplo n.º 3
0
def test_move_obstacle():

    player = Player(TestWorld)
    player.down()

    assert player.position == (0, 1)

    player = Player(TestWorld)
    player.right()

    assert player.position == (0, 0)
Exemplo n.º 4
0
def test_collect_starts():

    player = Player(TestWorldStarts)

    assert not player.world.is_solved()

    player.down()
    player.right()
    player.up()

    assert player.world.is_solved()
Exemplo n.º 5
0
def test_move_valid_1():

    player = Player(TestWorldEmpty)
    player.up()

    assert player.position == (1, 0)

    player = Player(TestWorldEmpty)
    player.right()

    assert player.position == (2, 1)

    player = Player(TestWorldEmpty)
    player.down()

    assert player.position == (1, 2)

    player = Player(TestWorldEmpty)
    player.left()

    assert player.position == (0, 1)