def test_windowmanager(self): with DisplayContext(): from xpra.client.mixins.window_manager import WindowClient def _WindowClient(): def get_mouse_position(): return 0, 0 wc = WindowClient() wc.get_mouse_position = get_mouse_position return wc opts = AdHocStruct() opts.system_tray = True opts.cursors = True opts.bell = True opts.input_devices = True opts.auto_refresh_delay = 0 opts.min_size = "100x100" opts.max_size = "2000x2000" opts.pixel_depth = 24 opts.windows = True opts.window_close = "forward" opts.modal_windows = True opts.border = "red" opts.mousewheel = "yes" opts.tray_icon = "yes" self._test_mixin_class(_WindowClient, opts)
def test_display(self): with DisplayContext(): from xpra.client.mixins.display import DisplayClient, log def _DisplayClient(): dc = DisplayClient() def get_root_size(): return 1024, 768 dc.get_root_size = get_root_size def get_screen_sizes(*_args): return ((1024, 768), ) dc.get_screen_sizes = get_screen_sizes return dc opts = AdHocStruct() opts.desktop_fullscreen = False opts.desktop_scaling = False opts.dpi = 144 with silence_info(log): self._test_mixin_class( _DisplayClient, opts, { "display": ":999", "desktop_size": (1024, 768), "max_desktop_size": (3840, 2160), "actual_desktop_size": (1024, 768), "resize_screen": True, })
def test_clipboard(self): with DisplayContext(): if POSIX and not OSX: from xpra.x11.gtk_x11.gdk_display_source import init_gdk_display_source init_gdk_display_source() from xpra.server.mixins.clipboard_server import ClipboardServer from xpra.server.source.clipboard_connection import ClipboardConnection opts = AdHocStruct() opts.clipboard = "yes" opts.clipboard_direction = "both" opts.clipboard_filter_file = None self._test_mixin_class(ClipboardServer, opts, {}, ClipboardConnection)
def test_input(self): with DisplayContext(): from xpra.server.mixins.input_server import InputServer from xpra.server.source.input_mixin import InputMixin opts = AdHocStruct() self._test_mixin_class(InputServer, opts, {}, InputMixin)
def main(): with DisplayContext(): unittest.main()
def test_display(self): with DisplayContext(): self.do_test_display()