def test_out_of_bounds(self):
"""Test the CameraOutOfBounds exception through
testing through the default camera behavior movement.
1. Create a camera
2. Create a rectangle whose topleft is out-of-bounds
of the Camera source surface.
3. Assert exception is raised!
"""
camera = Camera((800, 600), (1080, 1050), (300, 300))
out_of_bounds_coord = (2000, 2000)
out_of_bounds_rect = pygame.Rect(out_of_bounds_coord, [32, 32])
with pytest.raises(CameraOutOfBounds):
camera.scroll_to(out_of_bounds_rect)
camera.update_state(28974329)
评论列表
文章目录