Пример #1
0
def test_pkg_to_dict():
    pkg, ds = setup_pkg_docstorage()
    assert sorted(pkg_to_dict(pkg).keys()) == ['main.SomeClass',
                                               'main.SomeSubClass',
                                               'main.sub.func',
                                               'other.baz',
                                               'other.foo']
Пример #2
0
def test_pkg_to_dict():
    pkg, ds = setup_pkg_docstorage()
    assert sorted(pkg_to_dict(pkg).keys()) == [
        "main.SomeClass",
        "main.SomeSubClass",
        "main.sub.func",
        "other.baz",
        "other.foo",
    ]
Пример #3
0
def get_documentable_items_pkgdir(pkgdir):
    """ get all documentable items from an initpkg pkgdir
    
        this is a generic implementation, import as 'get_documentable_items'
        from your module when using initpkg to get all public stuff in the
        package documented
    """
    sys.path.insert(0, str(pkgdir.dirpath()))
    rootmod = __import__(pkgdir.basename)
    d = pkg_to_dict(rootmod)
    return pkgdir.basename, d