Пример #1
0
 def test_lazy_player_moves(self):
     """
     Checks that the lazy player step counter works
     """
     board = cs.Board()
     player = cs.LazyPlayer(board)
     player.move()
     player.move()
     assert player.step_counter() == 2
Пример #2
0
 def test_laziness(self):
     """
     Checks that the lazy player moves shorter after going up a ladder
     """
     board = cs.Board(ladders=([1, 10], [2, 10], [3, 10], [4, 10], [5, 10],
                               [6, 10]))
     player = cs.LazyPlayer(board, dropped_steps=5)
     player.move()
     player.move()
     assert player.position <= 11
     player.move()
     assert player.position >= 11
Пример #3
0
 def test_move(self):
     """LazyPlayer can move."""
     b = cs.Board()
     p = cs.LazyPlayer(b)
     p.move()
Пример #4
0
 def test_constructor(self):
     """LazyPlayer can be constructed."""
     b = cs.Board()
     p = cs.LazyPlayer(b, dropped_steps=3)
     assert isinstance(p, cs.LazyPlayer)
     assert isinstance(p, cs.Player)