def test_doesnt_include_test_package(): system = TwistedSystem() c = Class(system, "test", "some doc") assert c.isVisible p = Package(system, "test", "package doc") assert not p.isVisible
def _maybeAttribute(self, cls: model.Class, name: str) -> bool: """Check whether a name is a potential attribute of the given class. This is used to prevent an assignment that wraps a method from creating an attribute that would overwrite or shadow that method. @return: L{True} if the name does not exist or is an existing (possibly inherited) attribute, L{False} otherwise """ obj = cls.find(name) return obj is None or isinstance(obj, model.Attribute)
def subclassesFrom( hostsystem: model.System, cls: model.Class, anchors: MutableSet[str], page_url: str ) -> Tag: r: Tag = tags.li() if isClassNodePrivate(cls): r(class_='private') name = cls.fullName() if name not in anchors: r(tags.a(name=name)) anchors.add(name) r(tags.code(epydoc2stan.taglink(cls, page_url)), ' - ', epydoc2stan.format_summary(cls)) scs = [sc for sc in cls.subclasses if sc.system is hostsystem and ' ' not in sc.fullName() and sc.isVisible] if len(scs) > 0: ul = tags.ul() for sc in sorted(scs, key=_lckey): ul(subclassesFrom(hostsystem, sc, anchors, page_url)) r(ul) return r
def test_include_private(): system = TwistedSystem() c = Class(system, "_private", "some doc") assert c.isVisible
def test_include_private_not_in_all(): system = TwistedSystem() m = Module(system, "somemodule", "module doc") m.all = [] c = Class(system, "_private", "some doc", m) assert c.isVisible