def test_reorder_item(self): dockitem1 = DockItem() dockitem2 = DockItem() dockitem3 = DockItem() dockgroup = DockGroup() dockgroup.add(dockitem1) dockgroup.add(dockitem2) dockgroup.add(dockitem3) dockgroup.reorder_item(dockitem3, 0) dockgroup.reorder_item(dockitem1, 2) self.assertTrue(dockgroup.item_num(dockitem1) == 2) self.assertTrue(dockgroup.item_num(dockitem2) == 1) self.assertTrue(dockgroup.item_num(dockitem3) == 0) dockitem1.destroy() dockitem2.destroy() dockitem3.destroy() dockgroup.destroy()
def test_item_num(self): dockitem1 = DockItem() dockitem2 = DockItem() dockgroup = DockGroup() dockgroup.add(dockitem1) self.assertTrue(dockgroup.item_num(dockitem1) == 0) self.assertTrue(dockgroup.item_num(dockitem2) is None) dockitem1.destroy() dockgroup.destroy()