ai-content-maker/.venv/Lib/site-packages/pygame/tests/video_test.py

27 lines
694 B
Python
Raw Normal View History

2024-05-12 06:17:42 +03:00
import unittest
import sys
import pygame
from pygame._sdl2 import video
class VideoModuleTest(unittest.TestCase):
default_caption = "pygame window"
@unittest.skipIf(
not (sys.maxsize > 2**32),
"32 bit SDL 2.0.16 has an issue.",
)
def test_renderer_set_viewport(self):
"""works."""
window = video.Window(title=self.default_caption, size=(800, 600))
renderer = video.Renderer(window=window)
renderer.logical_size = (1920, 1080)
rect = pygame.Rect(0, 0, 1920, 1080)
renderer.set_viewport(rect)
self.assertEqual(renderer.get_viewport(), (0, 0, 1920, 1080))
if __name__ == "__main__":
unittest.main()