def test_Window_minimize(self): window = video.Window("Test Minimize Window", size=(200, 200)) window.show() doprint("""Please check, that a window with the title 'Test Minimize Window' is shown""") window.minimize() doprint("Please check, if the window was minimized properly")
def test_Window_maximize(self): window = video.Window("Test Maximize Window", size=(200, 200), flags=sdlvideo.SDL_WINDOW_RESIZABLE) window.show() doprint("""Please check, that a window with the title 'Test Maximize Window' is shown""") window.maximize() doprint("Please check, if the window was maximized properly")
def test_minimize_window(self): window = video.create_window("test_minimize_window", 200, 200, 200, 200, 0) video.show_window(window) doprint("""Please check, that a window with the title 'test_minimize_window' is shown""") video.minimize_window(window) doprint("Please check, if the window was minimized properly") video.destroy_window(window)
def test_pygame2_sdl_cdrom_num_drives(self): # __doc__ (as of 2009-12-14) for pygame2.sdl.cdrom.num_drives: # num_drives () -> int # # Gets the number of accessible CD- and DVD-ROM drives for the system. cdrom.init () doprint ("Found CD/DVD drives: %d" % cdrom.num_drives ()) cdrom.quit ()
def test_maximize_window(self): window = video.create_window("test_maximize_window", 200, 200, 200, 200, video.SDL_WINDOW_RESIZABLE) video.show_window(window) doprint("""Please check, that a window with the title 'test_maximize_window' is shown""") video.maximize_window(window) doprint("Please check, if the window was maximized properly") video.destroy_window(window)
def test_get_power_info(self): retval = power.get_power_info() state = "Unknown" if retval[0] == power.SDL_POWERSTATE_ON_BATTERY: state = "On battery" elif retval[0] == power.SDL_POWERSTATE_NO_BATTERY: state = "No battery" elif retval[0] == power.SDL_POWERSTATE_CHARGING: state = "Battery charging" elif retval[0] == power.SDL_POWERSTATE_CHARGED: state = "Battery charged" output = "Power Status: %s" % state + os.linesep output += "Minutes left (-1 = undetermined): %d" % (retval[1] / 60) + \ os.linesep output += "Percent left (-1 = undetermined): %d" % retval[2] + \ os.linesep doprint(output)
def test_pygame2_sdl_cdrom_get_name(self): # # __doc__ (as of 2009-12-14) for pygame2.sdl.cdrom.get_name: # get_name (index) -> str # # Gets the name of the specified CD- or DVD-ROM drive. # # Gets the system-dependent drive name (e.g. "/dev/cdrom" or "D:") # for the CD- or DVD-Rom specified by the passed *index*. cdrom.init () self.assertRaises (ValueError, cdrom.get_name, -4) self.assertRaises (ValueError, cdrom.get_name, cdrom.num_drives ()) for i in range (cdrom.num_drives ()): doprint ("Drive %d: %s" % (i, cdrom.get_name (i))) cdrom.quit ()
def test_Window_hide(self): window = video.Window("Test Hide Window", size=(200, 200)) window.show() doprint("""Please check, if a window with the title 'Test Hide Window' is shown""") window.hide() doprint("Please check, that the window is not shown anymore") window.show() doprint("Please check, if the window is shown again")
def test_raise_window(self): window = video.create_window("test_raise_window", 200, 200, 200, 200, 0) video.show_window(window) doprint("""Please check, that a window with the title 'test_raise_window' is shown""") doprint("Move another window on top of the window, so it is hidden") video.raise_window(window) doprint("The window should be raised to the foreground now") video.destroy_window(window)
def test_hide_window(self): window = video.create_window("test_hide_window", 200, 200, 200, 200, 0) video.show_window(window) doprint("""Please check, if a window with the title 'test_hide_window' is shown""") video.hide_window(window) doprint("Please check, that the window is not shown anymore") video.show_window(window) doprint("Please check, if the window is shown again") video.destroy_window(window)
def test_Window_show(self): window = video.Window("Test Show Window", size=(200, 200)) window.show() doprint("""Please check, if a window with the title 'Test Show Window' is shown""")
def test_show_window(self): window = video.create_window("test_show_window", 200, 200, 200, 200, 0) video.show_window(window) doprint("""Please check, if a window with the title 'test_show_window' is shown""") video.destroy_window(window)
def test_get_clipboard_text(self): doprint("Please put some text on the clipboard") retval = clipboard.get_clipboard_text() doprint("Clipboard content: '%s'" % retval)
def test_has_clipboard_text(self): doprint("Please put some text on the clipboard") self.assertTrue(clipboard.has_clipboard_text())