1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00
libxml2/python/tests/outbuf.py
Daniel Veillard c6d4a933f0 updated the python bindings, added code for easier File I/O, and the
* python/generator.py python/libxml.c python/libxml.py
  python/libxml2-python-api.xml python/libxml2class.txt
  python/libxml_wrap.h python/types.c: updated the python
  bindings, added code for easier File I/O, and the ability to
  define a resolver from Python fixing bug #91635
* python/tests/Makefile.am python/tests/inbuf.py
  python/tests/outbuf.py python/tests/pushSAXhtml.py
  python/tests/resolver.py python/tests/serialize.py: updated
  and augmented the set of Python tests.
Daniel
2002-09-12 15:00:57 +00:00

34 lines
580 B
Python
Executable File

#!/usr/bin/python -u
import sys
import libxml2
import StringIO
print "Skipped"
sys.exit(1)
# Memory debug specific
libxml2.debugMemory(1)
#f = open('res', 'w')
f = StringIO.StringIO()
buf = libxml2.createOutputBuffer(f, "ISO-8859-1")
buf.write(3, "foo")
buf.writeString("bar")
buf.close()
del buf
if f.getvalue() != "foobar":
print "Failed to save to StringIO"
sys.exit(1)
del f
# Memory debug specific
libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
print "OK"
else:
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
libxml2.dumpMemory()