Beispiel #1
0
 def test_example_difficulty_selector() -> None:
     """
     Test multi-input example.
     """
     game_selector.main(test=True)
     font = MenuUtils.load_font(MenuUtils.random_font(), 5)
     game_selector.play_function(['EASY'], font, test=True)
     game_selector.play_function(['MEDIUM'], font, test=True)
     game_selector.play_function(['HARD'], font, test=True)
     test_reset_surface()
Beispiel #2
0
 def test_example_game_selector(self) -> None:
     """
     Test game selector example.
     """
     game_selector.main(test=True)
     font = MenuUtils.load_font(MenuUtils.random_font(), 5)
     game_selector.play_function(['EASY'], font, test=True)
     pygame.event.post(
         PygameEventUtils.keydown(pygame.K_ESCAPE, inlist=False))
     game_selector.play_function(['MEDIUM'], font, test=True)
     pygame.event.post(
         PygameEventUtils.keydown(pygame.K_ESCAPE, inlist=False))
     game_selector.play_function(['HARD'], font, test=True)
     self.assertRaises(
         ValueError,
         lambda: game_selector.play_function(['U'], font, test=True))
     game_selector.change_difficulty(('HARD', 1), 'HARD')