def test_pygame2_sdl_base_was_init(self): # __doc__ (as of 2009-04-01) for pygame2.sdl.base.was_init: # was_init (flags) -> int # # Gets a bitwise OR'ed combination of the initialized SDL subsystems. # # Returns a bitwise combination of the currently initialized SDL # subsystems. base.init(constants.INIT_JOYSTICK) v = base.was_init(constants.INIT_JOYSTICK) & constants.INIT_JOYSTICK self.assertEqual(v, constants.INIT_JOYSTICK) base.quit()
def test_pygame2_sdl_base_init_subsystem(self): # __doc__ (as of 2009-04-01) for pygame2.sdl.base.init_subsystem: # init_subsystem (flags) -> bool # # Initializes one or more SDL subsystems. # # In case a specific part of SDL was not initialized using # pygame2.sdl.init(), this funciton can be used to initialize it # at a later time. In case an error occured, False will be # returned. The detailled error can be received using # pygame2.sdl.get_error(). self.assertEqual(base.init_subsystem(constants.INIT_CDROM), True) self.assertEqual(base.init_subsystem(constants.INIT_CDROM | constants.INIT_TIMER), True) base.quit()
def test_pygame2_sdl_base_init(self): # __doc__ (as of 2009-04-01) for pygame2.sdl.base.init: # init (flags) -> bool # # Initializes the underlying SDL library. # # Initializes the underlying SDL library using the passed SDL # flags. The flags indicate, which subsystems of SDL should be # initialized and can be a bitwise combination of the INIT_* # constants. In case an error occured, False will be # returned. The detailled error can be received using # pygame2.sdl.get_error(). self.assertEqual(base.init(constants.INIT_CDROM), True) self.assertEqual(base.init(constants.INIT_CDROM | constants.INIT_AUDIO), True) base.quit()
def test_pygame2_sdl_base_quit(self): # __doc__ (as of 2009-04-01) for pygame2.sdl.base.quit: # quit () -> None # # Shuts down all subsystems of the underlying SDL library. # # After calling this function, you should not invoke any SDL # related class, method or function as they are likely to fail # or might give unpredictable results. self.assertTrue(base.quit() == None)