def test_get_enabled_shift_locations_with_previous_shift(): """ Tests get_enabled_shift_locations where the previous shift is (3, 0) """ board = Board() game = Game(identifier=0, board=board) game.previous_shift_location = BoardLocation(3, 0) expected_disabled = BoardLocation(3, board.maze.maze_size - 1) enabled_shift_locations = game.get_enabled_shift_locations() assert expected_disabled not in enabled_shift_locations
def test_get_enabled_shift_locations_without_previous_shift(): """ Tests get_enabled_shift_locations where the previous shift is None """ board = Board() game = Game(identifier=0, board=board) enabled_shift_locations = game.get_enabled_shift_locations() assert set(enabled_shift_locations) == set(board.shift_locations)
def _enabled_shift_locations_to_dto(game: Game): """ Maps the shift locations of the Board without the previous shift location of Game to a DTO. """ return list(map(_board_location_to_dto, game.get_enabled_shift_locations()))