def check_geometry(geom): win, xclock = get_win('xclock', '-geometry', geom) win.resize_and_move(0, 0, 100, 200) win.set_geometry(geom) win2 = Window.by_name(xclock.NAME)[0] assert win2.x == win.x assert win2.y == win.y assert win2.w == win.w assert win2.h == win.h
def test_resize_and_move(): win, xclock = get_win('xclock', '-geometry', '+100+200') ofs_x = win.x ofs_y = win.y win.resize_and_move(10, 20, 130, 140) win2 = Window.by_name(xclock.NAME)[0] assert win.id == win2.id # FIXME: these don't really work, see the XXX inside resize_and_move ## assert win2.x == 10 + ofs_x ## assert win2.y == 20 + ofs_y assert win2.w == 130 assert win2.h == 140
def get_win(name, *args): get_app = getattr(Apps, 'get_%s' % name) xapp = get_app(*args) win = Window.by_name(get_app.NAME) return win[0], xapp