def test_shift_updates_pieces_on_pushed_out_card(): """ Tests shift """ board = Board() piece = board.create_piece() pushed_card = board.leftover_card piece.maze_card = board.maze[BoardLocation(0, 3)] board.shift(BoardLocation(board.maze.maze_size - 1, 3), 90) assert piece.maze_card == pushed_card
def test_shift_raises_error_on_invalid_rotation(): """ Tests shift validation """ board = Board() with pytest.raises(InvalidRotationException): board.shift(BoardLocation(0, 1), 70)
def test_shift_raises_error_on_invalid_location(): """ Tests shift validation """ board = Board() with pytest.raises(InvalidShiftLocationException): board.shift(BoardLocation(0, 0), 90)
def test_shift_updates_new_leftover(): """ Tests shift """ board = Board() pushed_out = board.maze[BoardLocation(board.maze.maze_size - 1, 1)] board.shift(BoardLocation(0, 1), 270) assert pushed_out == board.leftover_card
def test_shift_updates_old_leftover_rotation(): """ Tests shift """ board = Board() old_leftover = board.leftover_card board.shift(BoardLocation(0, 1), 270) assert old_leftover.rotation == 270