Commits

akalias  committed 1d1ed35

Added in many test stubs, hopefully some test faeries will fill some of them out.

  • Participants
  • Parent commits 74ac72e

Comments (0)

Files changed (16)

File test/base_test.py

-
 import unittest, pygame
-
+import test_utils
+from test_utils import test_not_implemented
 
 init_called = quit_called = 0
 def __PYGAMEinit__(): #called automatically by pygame.init()
 
 
 
-class BaseTest(unittest.TestCase):
+class BaseModuleTest(unittest.TestCase):
     def testAutoInit(self):
         pygame.init()
         pygame.quit()
         self.assertEqual(init_called, 1)
         self.assertEqual(quit_called, 1)
 
+    def test_get_error(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.get_error:
+
+          # pygame.get_error(): return errorstr
+          # get the current error message
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_sdl_byteorder(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.get_sdl_byteorder:
+
+          # pygame.get_sdl_byteorder(): return int
+          # get the byte order of SDL
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_sdl_version(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.get_sdl_version:
+
+          # pygame.get_sdl_version(): return major, minor, patch
+          # get the version number of SDL
+
+        self.assert_(test_not_implemented()) 
+
+    def test_init(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.init:
+
+          # pygame.init(): return (numpass, numfail)
+          # initialize all imported pygame modules
+
+        self.assert_(test_not_implemented()) 
+
+    def test_quit(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.quit:
+
+          # pygame.quit(): return None
+          # uninitialize all pygame modules
+
+        self.assert_(test_not_implemented()) 
+
+    def test_register_quit(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.register_quit:
+
+          # register_quit(callable): return None
+          # register a function to be called when pygame quits
+
+        self.assert_(test_not_implemented()) 
+
+    def test_segfault(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.base.segfault:
+
+          # crash
+
+        self.assert_(test_not_implemented()) 
 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/color_test.py

 import pygame
 import math
 
+import test_utils
+from test_utils import test_not_implemented
+
 ################################### CONSTANTS ##################################
 
 rgba_vals = [0, 1, 62, 63, 126, 127, 255]
 
 ################################################################################
 
-    def test_gamma_correct__verified_against_python_implementation(self):
+    def test_correct_gamma__verified_against_python_implementation(self):
         # gamma_correct defined at top of page
 
         gammas = map(lambda i: i / 10.0, range(1, 31)) # [0.1 .. 3.0]
 ################################################################################
 
 if __name__ == '__main__':
+    test_utils.get_fail_incomplete_tests_option()
     unittest.main()

File test/display_test.py

 import unittest
 import pygame, pygame.transform
 
+import test_utils
+from test_utils import test_not_implemented
 
-class DisplayTest( unittest.TestCase ):
-    
+class DisplayModuleTest( unittest.TestCase ):
     def test_update( self ):
         """ see if pygame.display.update takes rects with negative values.
         """
 
 
 
-    def test_init_quit( self ):
+    def test_init__quit( self ):
         """ see if initing, and quiting works.
         """
-
+        # old test, was disabled so placing reminder
+        self.assert_(test_not_implemented())
+        
         if 0:
             pygame.init()
             screen = pygame.display.set_mode((100,100))
             #pygame.quit()
-
+    
+    def test_Info(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.Info:
+    
+          # pygame.display.Info(): return VideoInfo
+          # Create a video display information object
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_flip(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.flip:
+    
+          # pygame.display.flip(): return None
+          # update the full display Surface to the screen
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_active(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.get_active:
+    
+          # pygame.display.get_active(): return bool
+          # true when the display is active on the display
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_caption(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.get_caption:
+    
+          # pygame.display.get_caption(): return (title, icontitle)
+          # get the current window caption
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_driver(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.get_driver:
+    
+          # pygame.display.get_driver(): return name
+          # get the name of the pygame display backend
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_init(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.get_init:
+    
+          # pygame.display.get_init(): return bool
+          # true if the display module is initialized
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_surface(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.get_surface:
+    
+          # pygame.display.get_surface(): return Surface
+          # get a reference to the currently set display surface
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_wm_info(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.get_wm_info:
+    
+          # pygame.display.get_wm_info(): return dict
+          # Get information about the current windowing system
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_gl_get_attribute(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.gl_get_attribute:
+    
+          # pygame.display.gl_get_attribute(flag): return value
+          # get the value for an opengl flag for the current display
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_gl_set_attribute(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.gl_set_attribute:
+    
+          # pygame.display.gl_set_attribute(flag, value): return None
+          # request an opengl display attribute for the display mode
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_iconify(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.iconify:
+    
+          # pygame.display.iconify(): return bool
+          # iconify the display surface
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_init(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.init:
+    
+          # pygame.display.init(): return None
+          # initialize the display module
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_list_modes(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.list_modes:
+    
+          # pygame.display.list_modes(depth=0, flags=pygame.FULLSCREEN): return list
+          # get list of available fullscreen modes
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_mode_ok(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.mode_ok:
+    
+          # pygame.display.mode_ok(size, flags=0, depth=0): return depth
+          # pick the best color depth for a display mode
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_quit(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.quit:
+    
+          # pygame.display.quit(): return None
+          # uninitialize the display module
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_caption(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.set_caption:
+    
+          # pygame.display.set_caption(title, icontitle=None): return None
+          # set the current window caption
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_gamma(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.set_gamma:
+    
+          # pygame.display.set_gamma(red, green=None, blue=None): return bool
+          # change the hardware gamma ramps
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_gamma_ramp(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.set_gamma_ramp:
+    
+          # change the hardware gamma ramps with a custom lookup
+          # pygame.display.set_gamma_ramp(red, green, blue): return bool
+          # set_gamma_ramp(red, green, blue): return bool
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_icon(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.set_icon:
+    
+          # pygame.display.set_icon(Surface): return None
+          # change the system image for the display window
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_mode(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.set_mode:
+    
+          # pygame.display.set_mode(resolution=(0,0), flags=0, depth=0): return Surface
+          # initialize a window or screen for display
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_palette(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.set_palette:
+    
+          # pygame.display.set_palette(palette=None): return None
+          # set the display color palette for indexed displays
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_toggle_fullscreen(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.display.toggle_fullscreen:
+    
+          # pygame.display.toggle_fullscreen(): return bool
+          # switch between fullscreen and windowed displays
+    
+        self.assert_(test_not_implemented()) 
 
     def test_vid_info( self ):
         """ 
         """
-
+        
+        # old test, was disabled so placing reminder
+        self.assert_(test_not_implemented())
+        
         if 0:
 
             pygame.init()
 
             #pygame.quit()
 
-
-
-
-
-
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/font_test.py

-import unittest
-import pygame
-
-class FontTest( unittest.TestCase ):
-    def testFontRendering( self ):
-        """ 
-        """
-        #print __file__
-        pygame.font.init ()
-        f = pygame.font.Font(None, 20)
-        s = f.render("foo", True, [0, 0, 0], [255, 255, 255])
-        s = f.render("xxx", True, [0, 0, 0], [255, 255, 255])
-        s = f.render("", True, [0, 0, 0], [255, 255, 255])
-        s = f.render("foo", False, [0, 0, 0], [255, 255, 255])
-        s = f.render("xxx", False, [0, 0, 0], [255, 255, 255])
-        s = f.render("xxx", False, [0, 0, 0])
-        s = f.render("   ", False, [0, 0, 0])
-        s = f.render("   ", False, [0, 0, 0], [255, 255, 255])
-        # null text should be 1 pixel wide.
-        s = f.render("", False, [0, 0, 0], [255, 255, 255])
-        self.assertEqual(s.get_size()[0], 1)
-        #print "fonttest done"
-        #pygame.font.quit ()
-
-if __name__ == '__main__':
-    unittest.main()
+import unittest
+
+import test_utils
+from test_utils import test_not_implemented
+
+import pygame
+
+class FontModuleTest( unittest.TestCase ):
+    def testFontRendering( self ):
+        """ 
+        """
+        #print __file__
+        pygame.font.init ()
+        f = pygame.font.Font(None, 20)
+        s = f.render("foo", True, [0, 0, 0], [255, 255, 255])
+        s = f.render("xxx", True, [0, 0, 0], [255, 255, 255])
+        s = f.render("", True, [0, 0, 0], [255, 255, 255])
+        s = f.render("foo", False, [0, 0, 0], [255, 255, 255])
+        s = f.render("xxx", False, [0, 0, 0], [255, 255, 255])
+        s = f.render("xxx", False, [0, 0, 0])
+        s = f.render("   ", False, [0, 0, 0])
+        s = f.render("   ", False, [0, 0, 0], [255, 255, 255])
+        # null text should be 1 pixel wide.
+        s = f.render("", False, [0, 0, 0], [255, 255, 255])
+        self.assertEqual(s.get_size()[0], 1)
+        #print "fonttest done"
+        #pygame.font.quit ()
+
+    def test_SysFont(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.SysFont:
+
+          # pygame.font.SysFont(name, size, bold=False, italic=False) -> Font
+          # create a pygame Font from system font resources
+          # 
+          # This will search the system fonts for the given font
+          # name. You can also enable bold or italic styles, and
+          # the appropriate system font will be selected if available.
+          # 
+          # This will always return a valid Font object, and will
+          # fallback on the builtin pygame font if the given font
+          # is not found.
+          # 
+          # Name can also be a comma separated list of names, in
+          # which case set of names will be searched in order. Pygame
+          # uses a small set of common font aliases, if the specific
+          # font you ask for is not available, a reasonable alternative
+          # may be used.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_default_font(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.get_default_font:
+
+          # pygame.font.get_default_font(): return string
+          # get the filename of the default font
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_fonts(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.get_fonts:
+
+          # pygame.font.get_fonts() -> list
+          # get a list of system font names
+          # 
+          # Returns the list of all found system fonts. Note that
+          # the names of the fonts will be all lowercase with spaces
+          # removed. This is how pygame internally stores the font
+          # names for matching.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_init(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.get_init:
+
+          # pygame.font.get_init(): return bool
+          # true if the font module is initialized
+
+        self.assert_(test_not_implemented()) 
+
+    def test_init(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.init:
+
+          # pygame.font.init(): return None
+          # initialize the font module
+
+        self.assert_(test_not_implemented()) 
+
+    def test_match_font(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.match_font:
+
+          # pygame.font.match_font(name, bold=0, italic=0) -> name
+          # find the filename for the named system font
+          # 
+          # This performs the same font search as the SysFont()
+          # function, only it returns the path to the TTF file
+          # that would be loaded. The font name can be a comma
+          # separated list of font names to try.
+          # 
+          # If no match is found, None is returned.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_quit(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.font.quit:
+
+          # pygame.font.quit(): return None
+          # uninitialize the font module
+
+        self.assert_(test_not_implemented()) 
+
+class FontTypeTest( unittest.TestCase ):
+    def test_get_ascent(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_ascent:
+    
+          # Font.get_ascent(): return int
+          # get the ascent of the font
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_bold(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_bold:
+    
+          # Font.get_bold(): return bool
+          # check if text will be rendered bold
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_descent(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_descent:
+    
+          # Font.get_descent(): return int
+          # get the descent of the font
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_height(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_height:
+    
+          # Font.get_height(): return int
+          # get the height of the font
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_italic(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_italic:
+    
+          # Font.get_italic(): return bool
+          # check if the text will be rendered italic
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_linesize(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_linesize:
+    
+          # Font.get_linesize(): return int
+          # get the line space of the font text
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_underline(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.get_underline:
+    
+          # Font.get_underline(): return bool
+          # check if text will be rendered with an underline
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_metrics(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.metrics:
+    
+          # Font.metrics(text): return list
+          # Gets the metrics for each character in the pased string.
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_render(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.render:
+    
+          # Font.render(text, antialias, color, background=None): return Surface
+          # draw text on a new Surface
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_bold(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.set_bold:
+    
+          # Font.set_bold(bool): return None
+          # enable fake rendering of bold text
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_italic(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.set_italic:
+    
+          # Font.set_bold(bool): return None
+          # enable fake rendering of italic text
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_set_underline(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.set_underline:
+    
+          # Font.set_underline(bool): return None
+          # control if text is rendered with an underline
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_size(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.font.Font.size:
+    
+          # Font.size(text): return (width, height)
+          # determine the amount of space needed to render text
+    
+        self.assert_(test_not_implemented()) 
+
+if __name__ == '__main__':
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/image__save_gl_surface_test.py

 
 if __name__ == '__main__': 
     unittest.main()
+
+    def test_frombuffer(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.frombuffer:
+
+          # pygame.image.frombuffer(string, size, format): return Surface
+          # create a new Surface that shares data inside a string buffer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_fromstring(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.fromstring:
+
+          # pygame.image.fromstring(string, size, format, flipped=False): return Surface
+          # create new Surface from a string buffer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_extended(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.get_extended:
+
+          # pygame.image.get_extended(): return bool
+          # test if extended image formats can be loaded
+
+        self.assert_(test_not_implemented()) 
+
+    def test_load_basic(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.load_basic:
+
+          # pygame.image.load(filename): return Surface
+          # pygame.image.load(fileobj, namehint=): return Surface
+          # load new image from a file
+
+        self.assert_(test_not_implemented()) 
+
+    def test_load_extended(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.load_extended:
+
+          # pygame module for image transfer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_save(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.save:
+
+          # pygame.image.save(Surface, filename): return None
+          # save an image to disk
+
+        self.assert_(test_not_implemented()) 
+
+    def test_save_extended(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.save_extended:
+
+          # pygame module for image transfer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_tostring(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.tostring:
+
+          # pygame.image.tostring(Surface, format, flipped=False): return string
+          # transfer image to string buffer
+
+        self.assert_(test_not_implemented()) 

File test/image_test.py

+import unittest
 
+import test_utils
+from test_utils import test_not_implemented
 
-
-import unittest
 import pygame, pygame.image, pygame.pkgdata
 import os
 
 import array
 
-
-
 def test_magic(f, magic_hex):
     """ tests a given file to see if the magic hex matches.
     """
     return 1
 
 
-class ImageTest( unittest.TestCase ):
-    
+class ImageModuleTest( unittest.TestCase ):
     def testLoadIcon(self):
         """ see if we can load the pygame icon.
         """
         self.assertEqual(surf.get_height(),32)
         self.assertEqual(surf.get_width(),32)
 
-
     def testLoadPNG(self):
         """ see if we can load a png.
         """
         surf = pygame.image.load(open(os.path.join("examples", "data", "alien1.jpg"), "rb"))
 
 
-    def testSave(self):
+    def test_save(self):
 
         s = pygame.Surface((10,10))
         s.fill((23,23,23))
         self.assertRaises(ValueError, pygame.image.tostring, no_alpha_surface, "RGBA_PREMULT")
         
 
-    def test_from_to_string(self):
+    def test_fromstring__and_tostring(self):
         """ see if fromstring, and tostring methods are symmetric.
         """
         
 
         self.assert_(AreSurfacesIdentical(test_surface, test_to_from_argb_string))
         #"ERROR: image.fromstring and image.tostring with ARGB are not symmetric"
+    
+    test_tostring = test_fromstring__and_tostring # for gen_stubs.py
 
+    def test_frombuffer(self):
 
+        # __doc__ (as of 2008-06-25) for pygame.image.frombuffer:
 
+          # pygame.image.frombuffer(string, size, format): return Surface
+          # create a new Surface that shares data inside a string buffer
 
+        self.assert_(test_not_implemented()) 
+
+    def test_get_extended(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.get_extended:
+
+          # pygame.image.get_extended(): return bool
+          # test if extended image formats can be loaded
+
+        self.assert_(test_not_implemented()) 
+
+    def test_load_basic(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.load_basic:
+
+          # pygame.image.load(filename): return Surface
+          # pygame.image.load(fileobj, namehint=): return Surface
+          # load new image from a file
+
+        self.assert_(test_not_implemented()) 
+
+    def test_load_extended(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.load_extended:
+
+          # pygame module for image transfer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_save_extended(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.image.save_extended:
+
+          # pygame module for image transfer
+
+        self.assert_(test_not_implemented()) 
 
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main()

File test/key_test.py

-import unittest
-import pygame
-import pygame.display
-
-
-class KeyTest (unittest.TestCase):
-
-    def test_import(self):
-        'does it import'
-        import pygame.key
-
-    def test_get_repeat(self):
-        pass
-        # the line below won't work because you need a window
-        #delay, interval = pygame.key.get_repeat()
-
-    def test_add_more_tests(self):
-        'we need to add more tests'
-        pass
-        #raise NotImplementedError("TODO: key tests need improving.")
-
-
-
-if __name__ == '__main__':
-    unittest.main()
+import unittest
+
+import test_utils
+from test_utils import test_not_implemented
+
+import pygame
+import pygame.display
+
+class KeyModuleTest(unittest.TestCase):
+    def test_import(self):
+        'does it import'
+        import pygame.key
+
+    def test_get_focused(self):
+        # __doc__ (as of 2008-06-25) for pygame.key.get_focused:
+
+          # pygame.key.get_focused(): return bool
+          # true if the display is receiving keyboard input from the system
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_mods(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.key.get_mods:
+
+          # pygame.key.get_mods(): return int
+          # determine which modifier keys are being held
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_pressed(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.key.get_pressed:
+
+          # pygame.key.get_pressed(): return bools
+          # get the state of all keyboard buttons
+
+        self.assert_(test_not_implemented()) 
+
+    def test_name(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.key.name:
+
+          # pygame.key.name(key): return string
+          # get the name of a key identifier
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_mods(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.key.set_mods:
+
+          # pygame.key.set_mods(int): return None
+          # temporarily set which modifier keys are pressed
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_repeat(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.key.set_repeat:
+
+          # pygame.key.set_repeat(): return None
+          # pygame.key.set_repeat(delay, interval): return None
+          # control how held keys are repeated
+
+        self.assert_(test_not_implemented()) 
+
+
+if __name__ == '__main__':
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/mask_test.py

+import unittest
 
-import unittest
+import test_utils
+from test_utils import test_not_implemented
+
 import pygame
 import pygame.mask
 
 #pygame.init()
 #pygame.display.set_mode((10,10))
 
-
-class MaskTest( unittest.TestCase ):
+class MaskTypeTest( unittest.TestCase ):
     
+    def test_Mask(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.mask.Mask:
+    
+          # pygame.Mask((width, height): return Mask
+          # pygame object for representing 2d bitmasks
+    
+        self.assert_(test_not_implemented()) 
+        
     def test_mask_access( self ):
         """ do the set_at, and get_at parts work correctly? 
         """
         #self.assertEqual(s.get_at((1,0)), (0, 0, 1, 255))
         #s.set_at((-1,0), (0, 0, 1, 255))
 
-
-
         # out of bounds, should get IndexError
         self.assertRaises(IndexError, lambda : m.get_at((-1,0)) )
         self.assertRaises(IndexError, lambda : m.set_at((-1,0), 1) )
         self.assertRaises(IndexError, lambda : m.set_at((10,0), 1) )
         self.assertRaises(IndexError, lambda : m.set_at((0,10), 1) )
 
-
-
-    def test_mask_from_surface(self):
+class MaskModuleTest(unittest.TestCase):
+    def test_from_surface(self):
         """  Does the mask.from_surface() work correctly?
         """
 
         r = m.get_bounding_rects()
 
         self.assertEquals(repr(r), "[<rect(0, 0, 2, 2)>, <rect(0, 3, 1, 1)>, <rect(3, 3, 1, 1)>]")
-        
-
-
-
 
 if __name__ == '__main__':
 
     if 1:
+        test_utils.get_fail_incomplete_tests_option()
         unittest.main()
     else:
-
         mask_from_surface = maskFromSurface
 
         surf = pygame.Surface((70,70), SRCALPHA, 32)
         print surf.get_at((0,0))
 
         print "asdf"
-        print surf
-
+        print surf

File test/movie_test.py

+import unittest
 
-import unittest
+import test_utils
+from test_utils import test_not_implemented
+
 import pygame, pygame.movie
 
-
 class MovieTest( unittest.TestCase ):
     
     def test_load_movie( self ):
         """ 
         """
-
+        self.assert_(test_not_implemented()) 
 
     def test_import(self):
         'does it import'
 
     def test_add_more_tests(self):
         'we need to add more tests'
-        pass
-        #raise NotImplementedError("TODO: movie tests need improving.")
+        self.assert_(test_not_implemented()) 
+
+    def test_Movie(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.movie.Movie:
+    
+          # pygame.movie.Movie(filename): return Movie
+          # pygame.movie.Movie(object): return Movie
+          # load an mpeg movie file
+    
+        self.assert_(test_not_implemented()) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/pixelarray_test.py

 import unittest
+
+import test_utils
+from test_utils import test_not_implemented
+
 import pygame
 
-class PixelArrayTest (unittest.TestCase):
+class PixelArrayTypeTest (unittest.TestCase):
+    def test_compare(self):
+        # __doc__ (as of 2008-06-25) for pygame.pixelarray.PixelArray.compare:
+
+          # PixelArray.compare (array, distance=0, weights=(0.299, 0.587, 0.114)): Return PixelArray
+          # Compares the PixelArray with another one.
+
+        self.assert_(test_not_implemented())
 
     def test_pixel_array (self):
         for bpp in (8, 16, 24, 32):
             self.assertEqual (newar[8][9], black)
             self.assertEqual (newar[9][9], black)
         #print "extract end"
+
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/rect_test.py

+import unittest
 
+import test_utils
+from test_utils import test_not_implemented
 
-
-import unittest
 from pygame import Rect
 
-class RectTest( unittest.TestCase ):
+class RectTypeTest( unittest.TestCase ):
     def testConstructionXYWidthHeight( self ):
         r = Rect(1,2,3,4)
         self.assertEqual( 1, r.left )
         self.assertEqual( (r.left,r.centery), r.midleft )
         self.assertEqual( (r.right,r.centery), r.midright )
     
-    def testNormalize( self ):
+    def test_normalize( self ):
         r = Rect( 1, 2, -3, -6 )
         r2 = Rect(r)
         r2.normalize()
         self.assertEqual( new_size, r.size )
         self.assertEqual( old_topleft, r.topleft )
 
-    def testContains( self ):
+    def test_contains( self ):
         r = Rect( 1, 2, 3, 4 )
         
         self.failUnless( r.contains( Rect( 2, 3, 1, 1 ) ),
         self.failIf( r.contains( Rect(4,6,0,0) ),
                      "r contains Rect(4,6,0,0)" )
     
-    def testCollidePoint( self ):
+    def test_collidepoint( self ):
         r = Rect( 1, 2, 3, 4 )
         
         self.failUnless( r.collidepoint( r.left, r.top ),
         self.failIf( r.collidepoint( r.right, r.bottom-1 ),
                      "r collides with point (right,bottom-1)" )
 
-    def testInflateLarger( self ):
+    def test_inflate__larger( self ):
         "The inflate method inflates around the center of the rectangle"
         r = Rect( 2, 4, 6, 8 )
         r2 = r.inflate( 4, 6 )
         self.assertEqual( r.width+4, r2.width )
         self.assertEqual( r.height+6, r2.height )
 
-    def testInflateSmaller( self ):
+    def test_inflate__smaller( self ):
         "The inflate method inflates around the center of the rectangle"
         r = Rect( 2, 4, 6, 8 )
         r2 = r.inflate( -4, -6 )
         self.assertEqual( r.width-4, r2.width )
         self.assertEqual( r.height-6, r2.height )
 
-    def testInflateLargerIP( self ):    
+    def test_inflate_ip__larger( self ):    
         "The inflate_ip method inflates around the center of the rectangle"
         r = Rect( 2, 4, 6, 8 )
         r2 = Rect( r )
         self.assertEqual( r.width-4, r2.width )
         self.assertEqual( r.height-6, r2.height )
 
-    def testInflateSmallerIP( self ):
+    def test_inflate_ip__smaller( self ):
         "The inflate method inflates around the center of the rectangle"
         r = Rect( 2, 4, 6, 8 )
         r2 = Rect( r )
         self.assertEqual( r.width-4, r2.width )
         self.assertEqual( r.height-6, r2.height )
 
-    def testClamp( self ):
+    def test_clamp( self ):
         r = Rect(10, 10, 10, 10)
         c = Rect(19, 12, 5, 5).clamp(r)
         self.assertEqual(c.right, r.right)
         c = Rect(5, 500, 22, 33).clamp(r)
         self.assertEqual(c.center, r.center)
 
-    def testClampIP( self ):
+    def test_clamp_ip( self ):
         r = Rect(10, 10, 10, 10)
         c = Rect(19, 12, 5, 5)
         c.clamp_ip(r)
         c.clamp_ip(r)
         self.assertEqual(c.center, r.center)
         
-    def testClip( self ):
+    def test_clip( self ):
         r1 = Rect( 1, 2, 3, 4 )
         self.assertEqual( Rect( 1, 2, 2, 2 ), r1.clip( Rect(0,0,3,4) ) )
         self.assertEqual( Rect( 2, 2, 2, 4 ), r1.clip( Rect(2,2,10,20) ) )
         self.assertEqual( r1, r1.clip( Rect(r1) ),
                           "r1 does not clip an identical rect to itself" )
         
-    def testMove( self ):
+    def test_move( self ):
         r = Rect( 1, 2, 3, 4 )
         move_x = 10
         move_y = 20
         expected_r2 = Rect(r.left+move_x,r.top+move_y,r.width,r.height)
         self.assertEqual( expected_r2, r2 )
     
-    def testMoveIP( self ):    
+    def test_move_ip( self ):    
         r = Rect( 1, 2, 3, 4 )
         r2 = Rect( r )
         move_x = 10
         expected_r2 = Rect(r.left+move_x,r.top+move_y,r.width,r.height)
         self.assertEqual( expected_r2, r2 )
     
-    def testUnion( self ):
+    def test_union( self ):
         r1 = Rect( 1, 1, 1, 2 )
         r2 = Rect( -2, -2, 1, 2 )
         self.assertEqual( Rect( -2, -2, 4, 5 ), r1.union(r2) )
     
-    def testUnionWithIdenticalRect( self ):
+    def test_union__with_identical_Rect( self ):
         r1 = Rect( 1, 2, 3, 4 )
         self.assertEqual( r1, r1.union( Rect(r1) ) )
     
-    def testUnionIP( self ):
+    def test_union_ip( self ):
         r1 = Rect( 1, 1, 1, 2 )
         r2 = Rect( -2, -2, 1, 2 )
         r1.union_ip(r2)
         self.assertEqual( Rect( -2, -2, 4, 5 ), r1 )
     
-    def testUnionAll( self ):
+    def test_unionall( self ):
         r1 = Rect( 0, 0, 1, 1 )
         r2 = Rect( -2, -2, 1, 1 )
         r3 = Rect( 2, 2, 1, 1 )
         r4 = r1.unionall( [r2,r3] )
         self.assertEqual( Rect(-2, -2, 5, 5), r4 )
     
-    def testUnionAllIP( self ):
+    def test_unionall_ip( self ):
         r1 = Rect( 0, 0, 1, 1 )
         r2 = Rect( -2, -2, 1, 1 )
         r3 = Rect( 2, 2, 1, 1 )
 
 
 
-    def testCollideRect( self ):
+    def test_colliderect( self ):
         r1 = Rect(1,2,3,4)
         self.failUnless( r1.colliderect( Rect(0,0,2,3) ),
                          "r1 does not collide with Rect(0,0,2,3)" )
         self.failIf( r1.colliderect( Rect(r1.right,r1.bottom,1,1) ),
                      "r1 collides with Rect(r1.right,r1.bottom,1,1)" )
 
+    def test_collidedict(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.rect.Rect.collidedict:
+
+          # Rect.collidedict(dict): return (key, value)
+          # test if one rectangle in a dictionary intersects
+
+        self.assert_(test_not_implemented()) 
+
+    def test_collidedictall(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.rect.Rect.collidedictall:
+
+          # Rect.collidedictall(dict): return [(key, value), ...]
+          # test if all rectangles in a dictionary intersect
+
+        self.assert_(test_not_implemented()) 
+
+    def test_collidelist(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.rect.Rect.collidelist:
+
+          # Rect.collidelist(list): return index
+          # test if one rectangle in a list intersects
+
+        self.assert_(test_not_implemented()) 
+
+    def test_collidelistall(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.rect.Rect.collidelistall:
+
+          # Rect.collidelistall(list): return indices
+          # test if all rectangles in a list intersect
+
+        self.assert_(test_not_implemented()) 
+
+    def test_fit(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.rect.Rect.fit:
+
+          # Rect.fit(Rect): return Rect
+          # resize and move a rectangle with aspect ratio
+
+        self.assert_(test_not_implemented()) 
 
     def testEquals( self ):
         """ check to see how the rect uses __eq__ 
         rect_list.remove(r2)
         self.assertRaises(ValueError, rect_list.remove, r2)
 
-
-
-
-
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/scrap_test.py

-import unittest
-import pygame
-import pygame.scrap as scrap
-
-class ScrapTest (unittest.TestCase):
-
-    def test_scrap_mode (self):
-        scrap.set_mode (pygame.SCRAP_SELECTION)
-        scrap.set_mode (pygame.SCRAP_CLIPBOARD)
-        self.assertRaises (ValueError, scrap.set_mode, 1099)
-
-    def test_scrap_put_text (self):
-        scrap.put (pygame.SCRAP_TEXT, "Hello world")
-        self.assertEquals (scrap.get (pygame.SCRAP_TEXT), "Hello world")
-
-        scrap.put (pygame.SCRAP_TEXT, "Another String")
-        self.assertEquals (scrap.get (pygame.SCRAP_TEXT), "Another String")
-
-    def test_scrap_put_image (self):
-        sf = pygame.image.load ("examples/data/asprite.bmp")
-        string = pygame.image.tostring (sf, "RGBA")
-        scrap.put (pygame.SCRAP_BMP, string)
-        self.assertEquals (scrap.get(pygame.SCRAP_BMP), string)
-
-    def test_scrap_put (self):
-        scrap.put ("arbitrary buffer", "buf")
-        r = scrap.get ("arbitrary buffer")
-        self.assertEquals (r, "buf")
-
-if __name__ == '__main__':
-    pygame.init ()
-    pygame.display.set_mode ((1, 1))
-    scrap.init ()
-    unittest.main()
+import unittest
+
+import test_utils
+from test_utils import test_not_implemented
+
+import pygame
+import pygame.scrap as scrap
+
+class ScrapModuleTest(unittest.TestCase):
+    def test_contains(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.scrap.contains:
+
+          # scrap.contains (type) -> bool
+          # Checks, whether a certain type is available in the clipboard.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.scrap.get:
+
+          # scrap.get (type) -> string
+          # Gets the data for the specified type from the clipboard.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_types(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.scrap.get_types:
+
+          # scrap.get_types () -> list
+          # Gets a list of the available clipboard types.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_init(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.scrap.init:
+
+          # scrap.init () -> None
+          # Initializes the scrap module.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_lost(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.scrap.lost:
+
+          # scrap.lost() -> bool
+          # Checks whether the clipboard is currently owned by the application.
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_mode (self):
+        scrap.set_mode (pygame.SCRAP_SELECTION)
+        scrap.set_mode (pygame.SCRAP_CLIPBOARD)
+        self.assertRaises (ValueError, scrap.set_mode, 1099)
+
+    def test_scrap_put_text (self):
+        scrap.put (pygame.SCRAP_TEXT, "Hello world")
+        self.assertEquals (scrap.get (pygame.SCRAP_TEXT), "Hello world")
+
+        scrap.put (pygame.SCRAP_TEXT, "Another String")
+        self.assertEquals (scrap.get (pygame.SCRAP_TEXT), "Another String")
+
+    def test_scrap_put_image (self):
+        sf = pygame.image.load ("examples/data/asprite.bmp")
+        string = pygame.image.tostring (sf, "RGBA")
+        scrap.put (pygame.SCRAP_BMP, string)
+        self.assertEquals (scrap.get(pygame.SCRAP_BMP), string)
+
+    def test_put (self):
+        scrap.put ("arbitrary buffer", "buf")
+        r = scrap.get ("arbitrary buffer")
+        self.assertEquals (r, "buf")
+
+if __name__ == '__main__':
+    test_utils.get_fail_incomplete_tests_option()
+
+    pygame.init ()
+    pygame.display.set_mode ((1, 1))
+    scrap.init ()
+    unittest.main()

File test/sndarray_test.py

-import unittest
-import pygame
-
-
-class SndarrayTest (unittest.TestCase):
-
-    def test_import(self):
-        'does it import'
-        import pygame.sndarray
-
-
-
-    def test_add_more_tests(self):
-        'we need to add more tests'
-        pass
-        #raise NotImplementedError("TODO: sndarray tests need improving.")
-
-
-
-if __name__ == '__main__':
-    unittest.main()
+import unittest
+
+import test_utils
+from test_utils import test_not_implemented
+
+import pygame
+
+class SndarrayTest (unittest.TestCase):
+    def test_import(self):
+        'does it import'
+        import pygame.sndarray
+    
+    def test_array(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.sndarray.array:
+    
+          # pygame.sndarray.array(Sound): return array
+          # 
+          # Copy Sound samples into an array.
+          # 
+          # Creates a new array for the sound data and copies the samples. The
+          # array will always be in the format returned from
+          # pygame.mixer.get_init().
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_arraytype(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.sndarray.get_arraytype:
+    
+          # pygame.sndarray.get_arraytype (): return str
+          # 
+          # Gets the currently active array type.
+          # 
+          # Returns the currently active array type. This will be a value of the
+          # get_arraytypes() tuple and indicates which type of array module is
+          # used for the array creation.
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_get_arraytypes(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.sndarray.get_arraytypes:
+    
+          # pygame.sndarray.get_arraytypes (): return tuple
+          # 
+          # Gets the array system types currently supported.
+          # 
+          # Checks, which array system types are available and returns them as a
+          # tuple of strings. The values of the tuple can be used directly in
+          # the use_arraytype () method.
+          # 
+          # If no supported array system could be found, None will be returned.
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_make_sound(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.sndarray.make_sound:
+    
+          # pygame.sndarray.make_sound(array): return Sound
+          # 
+          # Convert an array into a Sound object.
+          # 
+          # Create a new playable Sound object from an array. The mixer module
+          # must be initialized and the array format must be similar to the mixer
+          # audio format.
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_samples(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.sndarray.samples:
+    
+          # pygame.sndarray.samples(Sound): return array
+          # 
+          # Reference Sound samples into an array.
+          # 
+          # Creates a new array that directly references the samples in a Sound
+          # object. Modifying the array will change the Sound. The array will
+          # always be in the format returned from pygame.mixer.get_init().
+    
+        self.assert_(test_not_implemented()) 
+    
+    def test_use_arraytype(self):
+    
+        # __doc__ (as of 2008-06-25) for pygame.sndarray.use_arraytype:
+    
+          # pygame.sndarray.use_arraytype (arraytype): return None
+          # 
+          # Sets the array system to be used for sound arrays.
+          # 
+          # Uses the requested array type for the module functions.
+          # Currently supported array types are:
+          # 
+          #   numeric 
+          #   numpy
+          # 
+          # If the requested type is not available, a ValueError will be raised.
+    
+        self.assert_(test_not_implemented()) 
+
+
+if __name__ == '__main__':
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/surface_test.py

-
-import unittest
-import pygame
-
-from pygame.locals import *
-
-class SurfaceTest( unittest.TestCase ):
-    
-    def test_set_clip( self ):
-        """ see if surface.set_clip(None) works correctly.
-        """
-        s = pygame.Surface((800, 600))
-        r = pygame.Rect(10, 10, 10, 10)
-        s.set_clip(r)
-        r.move_ip(10, 0)
-        s.set_clip(None)
-        res = s.get_clip()
-        # this was garbled before.
-        self.assertEqual(res[0], 0)
-        self.assertEqual(res[2], 800)
-
-    def test_print(self):
-        surf = pygame.Surface((70,70), 0, 32)
-        self.assertEqual(repr(surf), '<Surface(70x70x32 SW)>')
-
-    def test_keyword_arguments(self):
-        surf = pygame.Surface((70,70), flags=SRCALPHA, depth=32)
-        self.assertEqual(surf.get_flags() & SRCALPHA, SRCALPHA)
-        self.assertEqual(surf.get_bitsize(), 32)
-        
-        # sanity check to make sure the check below is valid
-        surf_16 = pygame.Surface((70,70), 0, 16)
-        self.assertEqual(surf_16.get_bytesize(), 2)
-        
-        # try again with an argument list
-        surf_16 = pygame.Surface((70,70), depth=16)
-        self.assertEqual(surf_16.get_bytesize(), 2)
-
-    def test_set_at(self):
-
-        #24bit surfaces 
-        s = pygame.Surface( (100, 100), 0, 24)
-        s.fill((0,0,0))
-
-        # set it with a tuple.
-        s.set_at((0,0), (10,10,10, 255))
-        r = s.get_at((0,0))
-        self.assertEqual(r, (10,10,10, 255))
-
-        # try setting a color with a single integer.
-        s.fill((0,0,0,255))
-        s.set_at ((10, 1), 0x0000FF)
-        r = s.get_at((10,1))
-        self.assertEqual(r, (0,0,255, 255))
-
-
-    def test_SRCALPHA(self):
-        # has the flag been passed in ok?
-        surf = pygame.Surface((70,70), SRCALPHA, 32)
-        self.assertEqual(surf.get_flags() & SRCALPHA, SRCALPHA)
-
-        #24bit surfaces can not have SRCALPHA.
-        self.assertRaises(ValueError, pygame.Surface, (100, 100), pygame.SRCALPHA, 24)
-
-        # if we have a 32 bit surface, the SRCALPHA should have worked too.
-        surf2 = pygame.Surface((70,70), SRCALPHA)
-        if surf2.get_bitsize() == 32:
-            self.assertEqual(surf2.get_flags() & SRCALPHA, SRCALPHA)
-
-    def test_get_buffer (self):
-        surf = pygame.Surface ((70, 70), 0, 32)
-        buf = surf.get_buffer ()
-        # 70*70*4 bytes = 19600
-        self.assertEqual (repr (buf), "<BufferProxy(19600)>")
-
-    def test_get_bounding_rect (self):
-        surf = pygame.Surface ((70, 70), SRCALPHA, 32)
-        surf.fill((0,0,0,0))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.width, 0)
-        self.assertEqual(bound_rect.height, 0)
-        surf.set_at((30,30),(255,255,255,1))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.left, 30)
-        self.assertEqual(bound_rect.top, 30)
-        self.assertEqual(bound_rect.width, 1)
-        self.assertEqual(bound_rect.height, 1)
-        surf.set_at((29,29),(255,255,255,1))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.left, 29)
-        self.assertEqual(bound_rect.top, 29)
-        self.assertEqual(bound_rect.width, 2)
-        self.assertEqual(bound_rect.height, 2)
-        
-        surf = pygame.Surface ((70, 70), 0, 24)
-        surf.fill((0,0,0))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.width, surf.get_width())
-        self.assertEqual(bound_rect.height, surf.get_height())
-
-        surf.set_colorkey((0,0,0))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.width, 0)
-        self.assertEqual(bound_rect.height, 0)
-        surf.set_at((30,30),(255,255,255))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.left, 30)
-        self.assertEqual(bound_rect.top, 30)
-        self.assertEqual(bound_rect.width, 1)
-        self.assertEqual(bound_rect.height, 1)
-        surf.set_at((60,60),(255,255,255))
-        bound_rect = surf.get_bounding_rect()
-        self.assertEqual(bound_rect.left, 30)
-        self.assertEqual(bound_rect.top, 30)
-        self.assertEqual(bound_rect.width, 31)
-        self.assertEqual(bound_rect.height, 31)
-
-if __name__ == '__main__':
-    unittest.main()
+import unittest
+import pygame
+
+import test_utils
+from test_utils import test_not_implemented
+
+from pygame.locals import *
+
+class SurfaceTypeTest(unittest.TestCase):
+    def test_set_clip( self ):
+        """ see if surface.set_clip(None) works correctly.
+        """
+        s = pygame.Surface((800, 600))
+        r = pygame.Rect(10, 10, 10, 10)
+        s.set_clip(r)
+        r.move_ip(10, 0)
+        s.set_clip(None)
+        res = s.get_clip()
+        # this was garbled before.
+        self.assertEqual(res[0], 0)
+        self.assertEqual(res[2], 800)
+
+    def test_print(self):
+        surf = pygame.Surface((70,70), 0, 32)
+        self.assertEqual(repr(surf), '<Surface(70x70x32 SW)>')
+
+    def test_keyword_arguments(self):
+        surf = pygame.Surface((70,70), flags=SRCALPHA, depth=32)
+        self.assertEqual(surf.get_flags() & SRCALPHA, SRCALPHA)
+        self.assertEqual(surf.get_bitsize(), 32)
+        
+        # sanity check to make sure the check below is valid
+        surf_16 = pygame.Surface((70,70), 0, 16)
+        self.assertEqual(surf_16.get_bytesize(), 2)
+        
+        # try again with an argument list
+        surf_16 = pygame.Surface((70,70), depth=16)
+        self.assertEqual(surf_16.get_bytesize(), 2)
+
+    def test_set_at(self):
+
+        #24bit surfaces 
+        s = pygame.Surface( (100, 100), 0, 24)
+        s.fill((0,0,0))
+
+        # set it with a tuple.
+        s.set_at((0,0), (10,10,10, 255))
+        r = s.get_at((0,0))
+        self.assertEqual(r, (10,10,10, 255))
+
+        # try setting a color with a single integer.
+        s.fill((0,0,0,255))
+        s.set_at ((10, 1), 0x0000FF)
+        r = s.get_at((10,1))
+        self.assertEqual(r, (0,0,255, 255))
+
+
+    def test_SRCALPHA(self):
+        # has the flag been passed in ok?
+        surf = pygame.Surface((70,70), SRCALPHA, 32)
+        self.assertEqual(surf.get_flags() & SRCALPHA, SRCALPHA)
+
+        #24bit surfaces can not have SRCALPHA.
+        self.assertRaises(ValueError, pygame.Surface, (100, 100), pygame.SRCALPHA, 24)
+
+        # if we have a 32 bit surface, the SRCALPHA should have worked too.
+        surf2 = pygame.Surface((70,70), SRCALPHA)
+        if surf2.get_bitsize() == 32:
+            self.assertEqual(surf2.get_flags() & SRCALPHA, SRCALPHA)
+
+    def test_get_buffer (self):
+        surf = pygame.Surface ((70, 70), 0, 32)
+        buf = surf.get_buffer ()
+        # 70*70*4 bytes = 19600
+        self.assertEqual (repr (buf), "<BufferProxy(19600)>")
+
+    def test_get_bounding_rect (self):
+        surf = pygame.Surface ((70, 70), SRCALPHA, 32)
+        surf.fill((0,0,0,0))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.width, 0)
+        self.assertEqual(bound_rect.height, 0)
+        surf.set_at((30,30),(255,255,255,1))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.left, 30)
+        self.assertEqual(bound_rect.top, 30)
+        self.assertEqual(bound_rect.width, 1)
+        self.assertEqual(bound_rect.height, 1)
+        surf.set_at((29,29),(255,255,255,1))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.left, 29)
+        self.assertEqual(bound_rect.top, 29)
+        self.assertEqual(bound_rect.width, 2)
+        self.assertEqual(bound_rect.height, 2)
+        
+        surf = pygame.Surface ((70, 70), 0, 24)
+        surf.fill((0,0,0))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.width, surf.get_width())
+        self.assertEqual(bound_rect.height, surf.get_height())
+
+        surf.set_colorkey((0,0,0))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.width, 0)
+        self.assertEqual(bound_rect.height, 0)
+        surf.set_at((30,30),(255,255,255))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.left, 30)
+        self.assertEqual(bound_rect.top, 30)
+        self.assertEqual(bound_rect.width, 1)
+        self.assertEqual(bound_rect.height, 1)
+        surf.set_at((60,60),(255,255,255))
+        bound_rect = surf.get_bounding_rect()
+        self.assertEqual(bound_rect.left, 30)
+        self.assertEqual(bound_rect.top, 30)
+        self.assertEqual(bound_rect.width, 31)
+        self.assertEqual(bound_rect.height, 31)
+
+
+    def test_blit(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.blit:
+
+          # Surface.blit(source, dest, area=None, special_flags = 0): return Rect
+          # draw one image onto another
+
+        self.assert_(test_not_implemented()) 
+
+    def test_convert(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.convert:
+
+          # Surface.convert(Surface): return Surface
+          # Surface.convert(depth, flags=0): return Surface
+          # Surface.convert(masks, flags=0): return Surface
+          # Surface.convert(): return Surface
+          # change the pixel format of an image
+
+        self.assert_(test_not_implemented()) 
+
+    def test_convert_alpha(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.convert_alpha:
+
+          # Surface.convert_alpha(Surface): return Surface
+          # Surface.convert_alpha(): return Surface
+          # change the pixel format of an image including per pixel alphas
+
+        self.assert_(test_not_implemented()) 
+
+    def test_copy(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.copy:
+
+          # Surface.copy(): return Surface
+          # create a new copy of a Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_fill(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.fill:
+
+          # Surface.fill(color, rect=None, special_flags=0): return Rect
+          # fill Surface with a solid color
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_abs_offset(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_abs_offset:
+
+          # Surface.get_abs_offset(): return (x, y)
+          # find the absolute position of a child subsurface inside its top level parent
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_abs_parent(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_abs_parent:
+
+          # Surface.get_abs_parent(): return Surface
+          # find the top level parent of a subsurface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_alpha(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_alpha:
+
+          # Surface.get_alpha(): return int_value or None
+          # get the current Surface transparency value
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_at(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_at:
+
+          # Surface.get_at((x, y)): return Color
+          # get the color value at a single pixel
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_bitsize(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_bitsize:
+
+          # Surface.get_bitsize(): return int
+          # get the bit depth of the Surface pixel format
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_bytesize(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_bytesize:
+
+          # Surface.get_bytesize(): return int
+          # get the bytes used per Surface pixel
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_clip(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_clip:
+
+          # Surface.get_clip(): return Rect
+          # get the current clipping area of the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_colorkey(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_colorkey:
+
+          # Surface.get_colorkey(): return RGB or None
+          # Get the current transparent colorkey
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_flags(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_flags:
+
+          # Surface.get_flags(): return int
+          # get the additional flags used for the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_height(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_height:
+
+          # Surface.get_height(): return height
+          # get the height of the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_locked(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_locked:
+
+          # Surface.get_locked(): return bool
+          # test if the Surface is current locked
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_locks(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_locks:
+
+          # Surface.get_locks(): return tuple
+          # Gets the locks for the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_losses(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_losses:
+
+          # Surface.get_losses(): return (R, G, B, A)
+          # the significant bits used to convert between a color and a mapped integer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_masks(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_masks:
+
+          # Surface.get_masks(): return (R, G, B, A)
+          # the bitmasks needed to convert between a color and a mapped integer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_offset(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_offset:
+
+          # Surface.get_offset(): return (x, y)
+          # find the position of a child subsurface inside a parent
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_palette(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_palette:
+
+          # Surface.get_palette(): return [RGB, RGB, RGB, ...]
+          # get the color index palette for an 8bit Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_palette_at(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_palette_at:
+
+          # Surface.get_palette_at(index): return RGB
+          # get the color for a single entry in a palette
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_parent(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_parent:
+
+          # Surface.get_parent(): return Surface
+          # find the parent of a subsurface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_pitch(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_pitch:
+
+          # Surface.get_pitch(): return int
+          # get the number of bytes used per Surface row
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_rect(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_rect:
+
+          # Surface.get_rect(**kwargs): return Rect
+          # get the rectangular area of the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_shifts(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_shifts:
+
+          # Surface.get_shifts(): return (R, G, B, A)
+          # the bit shifts needed to convert between a color and a mapped integer
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_size(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_size:
+
+          # Surface.get_size(): return (width, height)
+          # get the dimensions of the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_get_width(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_width:
+
+          # Surface.get_width(): return width
+          # get the width of the Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_lock(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.lock:
+
+          # Surface.lock(): return None
+          # lock the Surface memory for pixel access
+
+        self.assert_(test_not_implemented()) 
+
+    def test_map_rgb(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.map_rgb:
+
+          # Surface.map_rgb(Color): return mapped_int
+          # convert a color into a mapped color value
+
+        self.assert_(test_not_implemented()) 
+
+    def test_mustlock(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.mustlock:
+
+          # Surface.mustlock(): return bool
+          # test if the Surface requires locking
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_alpha(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.set_alpha:
+
+          # Surface.set_alpha(value, flags=0): return None
+          # Surface.set_alpha(None): return None
+          # set the alpha value for the full Surface image
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_colorkey(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.set_colorkey:
+
+          # Surface.set_colorkey(Color, flags=0): return None
+          # Surface.set_colorkey(None): return None
+          # Set the transparent colorkey
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_palette(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.set_palette:
+
+          # Surface.set_palette([RGB, RGB, RGB, ...]): return None
+          # set the color palette for an 8bit Surface
+
+        self.assert_(test_not_implemented()) 
+
+    def test_set_palette_at(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.set_palette_at:
+
+          # Surface.set_at(index, RGB): return None
+          # set the color for a single index in an 8bit Surface palette
+
+        self.assert_(test_not_implemented()) 
+
+    def test_subsurface(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.subsurface:
+
+          # Surface.subsurface(Rect): return Surface
+          # create a new surface that references its parent
+
+        self.assert_(test_not_implemented()) 
+
+    def test_unlock(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.unlock:
+
+          # Surface.unlock(): return None
+          # unlock the Surface memory from pixel access
+
+        self.assert_(test_not_implemented()) 
+
+    def test_unmap_rgb(self):
+
+        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.unmap_rgb:
+
+          # Surface.map_rgb(mapped_int): return Color
+          # convert a mapped integer color value into a Color
+
+        self.assert_(test_not_implemented()) 
+
+
+if __name__ == '__main__':
+    test_utils.get_fail_incomplete_tests_option()
+    unittest.main()

File test/surfarray_test.py

-import unittest
-import pygame
-