def test_reset_window(self): res = [100, 100] game = Game() game.autoscale = False game.resolution = res game._window = MagicMock() game._window.get_size.return_value = res game.reset_window(fullscreen=False, create=False) assert game.fullscreen == False
def test_create_bars_and_scale(self, screen_size, game_resolution, window_size, scaling_factor, expected_displacement): # Fit game to requested window size game = Game() game.resolution = game_resolution # the native size of the game graphics game._window = MagicMock() game._window.get_size.return_value = screen_size game.create_bars_and_scale(screen_size[0], screen_size[0], scaling_factor) assert game._window_dx == expected_displacement[ 0] # displacement by fullscreen mode assert game._window_dy == expected_displacement[ 1] # displacement by fullscreen mode