def NewTestSuite(dbsuite): """Return a runnable Suite converted from a database TestSuite.""" if dbsuite.valid: return newclass(identifier(dbsuite.name), core.TestSuite) else: raise InvalidObjectError("%s is not runnable (not valid)." % (dbsuite, ))
def get_class(dtdmod, name, bases): try: cls = dtdmod._CLASSCACHE[name] except KeyError: cls = newclass(name, *bases) dtdmod._CLASSCACHE[name] = cls return cls
def test_newclass(self): New = aid.newclass("New", MyBaseClass) print(New())
def new_menu(): doc = XFCE4Menu(xfdesktop_menu) RootMenu = newclass("RootMenu", MenuMixin, xfdesktop_menu.Xfdesktop_menu) root = RootMenu() doc.set_root(root) return doc
def add_submenu(self, **attribs): Menu = newclass("Menu", MenuMixin, xfdesktop_menu.Menu) menu = Menu(**attribs) self.append(menu) return menu