def test_in_axis_geometry(self): geometry = self.win.geometry in_axis = manipulate.in_axis_geometry(geometry, 'x') self.assertEqual( in_axis, core.Geometry(geometry.x, 0, geometry.width, DESKTOP_HEIGHT)) in_axis = manipulate.in_axis_geometry(geometry, 'y') self.assertEqual( in_axis, core.Geometry(0, geometry.y, DESKTOP_WIDTH, geometry.height))
def test_maximal_size(self): max_geometry = core.Geometry(0, 0, DESKTOP_WIDTH, DESKTOP_HEIGHT) self.win.set_geometry(max_geometry) resized = self.resize(self.win, ALL) self.assertEqual(resized.x, 0) self.assertEqual(resized.y, 0) self.assertEqual(resized.x2, DESKTOP_WIDTH) self.assertEqual(resized.y2, DESKTOP_HEIGHT)
def test_in_direction_geometry__inclusive(self): geometry = self.win.geometry workarea = self.WM.workarea_geometry in_direction = manipulate.in_direction_geometry(geometry, ALL, True) self.assertEqual(in_direction, self.WM.workarea_geometry) in_direction = manipulate.in_direction_geometry( geometry, TOP_LEFT, True) self.assertEqual(in_direction, core.Geometry(0, 0, geometry.x2, geometry.y2)) in_direction = manipulate.in_direction_geometry(geometry, TOP, True) self.assertEqual(in_direction, core.Geometry(0, 0, workarea.width, geometry.y2)) in_direction = manipulate.in_direction_geometry( geometry, TOP_RIGHT, True) self.assertEqual( in_direction, core.Geometry(geometry.x, 0, workarea.width - geometry.x, geometry.y2)) in_direction = manipulate.in_direction_geometry(geometry, LEFT, True) self.assertEqual(in_direction, core.Geometry(0, 0, geometry.x2, workarea.height)) in_direction = manipulate.in_direction_geometry(geometry, RIGHT, True) self.assertEqual( in_direction, core.Geometry(geometry.x, 0, workarea.width - geometry.x, workarea.height)) in_direction = manipulate.in_direction_geometry( geometry, BOTTOM_LEFT, True) self.assertEqual( in_direction, core.Geometry(0, geometry.y, geometry.x2, workarea.height - geometry.y)) in_direction = manipulate.in_direction_geometry(geometry, BOTTOM, True) self.assertEqual( in_direction, core.Geometry(0, geometry.y, workarea.width, workarea.height - geometry.y)) in_direction = manipulate.in_direction_geometry( geometry, BOTTOM_RIGHT, True) self.assertEqual( in_direction, core.Geometry(geometry.x, geometry.y, workarea.width - geometry.x, workarea.height - geometry.y))
def get_geometry(self, x, y): return core.Geometry(x, y, WIN_WIDTH, WIN_HEIGHT)