@@ -321,40 +321,37 @@ def test_from_display_module(self):
321321
322322 def test_window_surface (self ):
323323 win = Window (size = (640 , 480 ))
324- surf = win .get_surface ()
325324
326- self .assertIsInstance (surf , pygame .Surface )
325+ self .assertIsInstance (win . surface , pygame .Surface )
327326
328327 # test auto resize
329- self .assertTupleEqual (win .size , surf .get_size ())
328+ self .assertTupleEqual (win .size , win . surface .get_size ())
330329 win .size = (100 , 100 )
331- self .assertTupleEqual (win .size , surf .get_size ())
330+ self .assertTupleEqual (win .size , win . surface .get_size ())
332331 win .size = (1280 , 720 )
333- self .assertTupleEqual (win .size , surf .get_size ())
332+ self .assertTupleEqual (win .size , win . surface .get_size ())
334333
335334 # window surface should be invalid after the window is destroyed
336335 win .destroy ()
337- self .assertRaises (pygame .error , lambda : surf .fill ((0 , 0 , 0 )))
336+ self .assertRaises (pygame .error , lambda : win . surface .fill ((0 , 0 , 0 )))
338337
339338 def test_window_surface_with_display_module (self ):
340- # get_surface() should raise an error if the set_mode() is not called.
339+ # surface property should raise an error if the set_mode() is not called.
341340 pygame .display .set_mode ((640 , 480 ))
342341 win1 = Window .from_display_module ()
343342 pygame .display .quit ()
344343 pygame .init ()
345- self .assertRaises (pygame .error , lambda : win1 .get_surface () )
344+ self .assertRaises (pygame .error , lambda : win1 .surface )
346345
347- # the surface returned by get_surface() should be
346+ # the surface returned by surface property should be
348347 # the surface returned by set_mode()
349348 surf1 = pygame .display .set_mode ((640 , 480 ))
350349 win2 = Window .from_display_module ()
351- surf2 = win2 .get_surface ()
352- self .assertIs (surf1 , surf2 )
350+ self .assertIs (surf1 , win2 .surface )
353351
354352 def test_window_flip (self ):
355353 win = Window (size = (640 , 480 ))
356- surf = win .get_surface ()
357- surf .fill ((255 , 0 , 0 ))
354+ win .surface .fill ((255 , 0 , 0 ))
358355
359356 self .assertRaises (TypeError , lambda : win .flip ("an argument" ))
360357 self .assertIs (win .flip (), None )
0 commit comments