Ejemplo n.º 1
0
def test_get_metadata_unimplemented(dummy_package):
    print("@@ GMU sys.path={}".format(sys.path))
    f = open(os.path.join(dummy_package, "unimpl.py"), "w")
    f.write("class U(object):\n"
            "    @classmethod\n"
            "    def get_metadata(cls):\n"
            "        raise NotImplementedError\n")
    f.close()
    w = codesearch.ModuleClassWalker(from_path=dummy_package,
                                     suppress_warnings=True)
    visitor = codesearch.PropertyMetadataVisitor()
    w.walk(visitor)
Ejemplo n.º 2
0
def test_metadata_visitor():
    mv = codesearch.PropertyMetadataVisitor()
    mv.visit(MetadataHaver())