6
# Memory debug specific
9
def myResolver(URL, ID, ctxt):
10
return(StringIO.StringIO("<foo/>"))
12
libxml2.setEntityLoader(myResolver)
14
doc = libxml2.parseFile("doesnotexist.xml")
16
if root.name != "foo":
17
print "root element name error"
23
doc = libxml2.parseFile("doesnotexist.xml")
25
if root.name != "foo":
26
print "root element name error"
32
# Memory debug specific
33
libxml2.cleanupParser()
34
if libxml2.debugMemory(1) == 0:
37
print "Memory leak %d bytes" % (libxml2.debugMemory(1))