Current File : //opt/imh-python/lib/python2.7/test/test_sax.pyc
�
��Wc@saddlmZmZmZmZmZye�Wnek
rRed��nXddlmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZddlmZmZmZddlmZddlZddlZddlZddlZddljZdd	lm Z m!Z!m"Z"ddl#Z#e d
dd�Z$e d
dd�Z%e&Z'ej(j'r�yej)j*ej+�Wn e,e-e.fk
r�e/Z'nXne#j0e'd�Z1dZ2de#j3fd��YZ4e5d�Z6e7d�Z8e7d�Z9de#j3fd��YZ:de#j3fd��YZ;de#j3fd��YZ<de#j3fd��YZ=dZ>dfd��YZ?d e?e#j3fd!��YZ@d"e?e#j3fd#��YZAd$e?e#j3fd%��YZBd&e#j3fd'��YZCeDe%�jE�ZFd(e4fd)��YZGd*e#j3fd+��YZHd,e4fd-��YZId.�ZJeKd/kr]eJ�ndS(0i����(tmake_parsertContentHandlertSAXExceptiontSAXReaderNotAvailabletSAXParseExceptionsno XML parsers available(tXMLGeneratortescapetunescapet	quoteattrt
XMLFilterBasetprepare_input_source(t
create_parser(tfeature_namespaces(tInputSourcetAttributesImpltAttributesNSImpl(tStringION(tfindfiletrun_unittesttTESTFNstest.xmltsubdirtxmltestdatastest.xml.outs"Requires unicode filenames supports%http://www.python.org/xml-ns/saxtest/tXmlTestBasecBs#eZd�Zd�Zd�ZRS(cCsW|jt|jd�|jt|jd�|jt|jd�|jt|jd�|jt|jd�|j|j�d�|j|j	�g�|j|j
�g�|jt|�d�|j|j
d��|j|j�g�|j|jd�d�|j|jdd�d�|j|j�g�|j|j�g�dS(Ntattritattrsi(tassertRaisestKeyErrortgetValuetgetValueByQNametgetNameByQNametgetQNameByNamet__getitem__tassertEqualt	getLengthtgetNamest	getQNamestlentassertFalsethas_keytkeystgettNonetitemstvalues(tselfR((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytverify_empty_attrs+scCs{|jt|jtdf�|jt|jd�|jt|jd�|jt|jtdf�|jt|jtdf�|j|j	�d�|j|j
�g�|j|j�g�|jt|�d�|j
|jtdf��|j|j�g�|j|jtdf�d�|j|jtdfd�d�|j|j�g�|j|j�g�dS(NRsns:attrii(RRRtns_uriRRRRR R!R"R#R$R%R&R'R(R)R*R+(R,R((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytverify_empty_nsattrs<s"cCsp|j|j�d�|j|j�dg�|j|j�dg�|jt|�d�|j|jd��|j|j�dg�|j|jd�d�|j|jdd�d�|j|j	�dg�|j|j
�dg�|j|jd�d�|j|jd�d�|j|j
d�d�|j|dd�|j|jd�d�dS(NiRtvali(sattrR0(R R!R"R#R$t
assertTrueR&R'R(R*R+RRRR(R,R((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytverify_attrs_wattrMs(t__name__t
__module__R-R/R2(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR*s		cCs|dkr|Sd||fS(Nu&<?xml version="1.0" encoding="%s"?>
%s(R)(tdoctencoding((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytxml_unicode_scCs.|tkr|}nt||�j|d�S(Ntxmlcharrefreplace(tEllipsisR7tencode(R5R6t
decl_encoding((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt	xml_bytesds	cCsV|tkr|}ntjtdd|dd��}|jt||��WdQXdS(NtwR6terrorsR8(R9tiotopenRtwriteR7(R5R6R;tf((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt
make_xml_fileis	!t	ParseTestcBsMeZejd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(sB<money value="$\xa3\u20ac\U0001017b">$\xa3\u20ac\U0001017b</money>cCstjt�dS(N(tsupporttunlinkR(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttearDowntscCsUddlm}t�}||t|d��|j|j�t|jd��dS(Ni����(tparsesutf-8(txml.saxRHRRR tgetvalueR<tdata(R,RBRHtresult((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytcheck_parsews	cCs�d	}x�|D]�}|jtjt|j|���t|j|�|jt�tjtd��}|j|�WdQX|jtjt|j|d���t|j|d�|jt�tjtd��}|j|�WdQXq
W|jtjt|jdd���t|jdd�|jt�tjtd��}|j|�WdQX|jtjt|jdd���t|jdd�|jt�tjtd��}|j|�WdQX|jtjt|jd���t|jd�|jt�tjtd��}|j|�WdQX|j	t
��*|jtjt|jdd���WdQXt|jdd�|j	t
��|jt�WdQXtjtd��*}|j	t
��|j|�WdQXWdQXdS(
Nsus-asciisutf-8sutf-16sutf-16lesutf-16betrbs	utf-8-sigs
iso-8859-1(sus-asciisutf-8sutf-16sutf-16lesutf-16be(RMR?tBytesIOR<RKRCRR@R)RR(R,t	encodingsR6RB((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_parse_bytes}sF
"
%
%
%
"
+cCsbt|jdd�tjtd��7}t�}|j|�|jd�|j	|�WdQXdS(Ns
iso-8859-1RN(
RCRKR)R?R@RR
t
setByteStreamtsetEncodingRM(R,RBtinput((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_parse_InputSource�s	

cCsUddlm}t�}||t|d��|j|j�t|jd��dS(Ni����(tparseStringsutf-8(RIRVRRR RJR<RK(R,tsRVRL((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytcheck_parseString�s	c	Cs�d}xC|D];}|jt|j|��|jt|j|d��q
W|jt|jdd��|jt|jdd��|jt|jd��|jt��!|jt|jdd��WdQXdS(	Nsus-asciisutf-8sutf-16sutf-16lesutf-16bes	utf-8-sigs
iso-8859-1(sus-asciisutf-8sutf-16sutf-16lesutf-16be(RXR<RKR)RR(R,RPR6((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_parseString_bytes�s
 (R3R4REtuRKRGRMRQRURXRY(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyRDps			*			tMakeParserTestcBseZd�ZRS(cCs�ddlm}|�}ddlm}|�}ddlm}|�}ddlm}|�}ddlm}|�}ddlm}|�}dS(Ni����(R(RIR(R,Rtp((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_make_parser2�s					(R3R4R](((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR[�stSaxutilsTestcBsteZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(cCs|jtd�d�dS(NsDonald Duck & CosDonald Duck &amp; Co(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_escape_basic�scCs|jtd�d�dS(Ns<Donald Duck & Co>s&lt;Donald Duck &amp; Co&gt;(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_escape_all�scCs$|jtdidd6�d�dS(NsHei på degs&aring;såsHei p&aring; deg(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_escape_extra�scCs|jtd�d�dS(NsDonald Duck &amp; CosDonald Duck & Co(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_unescape_basic�scCs|jtd�d�dS(Ns&lt;Donald Duck &amp; Co&gt;s<Donald Duck & Co>(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_unescape_all�scCs$|jtdidd6�d�dS(NsHei på degs&aring;såsHei p&aring; deg(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_unescape_extra�scCs$|jtdidd6�d�dS(Ns	&amp;foo;tsplats&foo;(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_unescape_amp_extra�scCs|jtd�d�dS(NsDonald Duck & Cos"Donald Duck &amp; Co"(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_quoteattr_basic�scCs|jtd�d�dS(NsIncludes "double" quotess'Includes "double" quotes'(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_single_quoteattrscCs|jtd�d�dS(NsIncludes 'single' quotess"Includes 'single' quotes"(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_double_quoteattrscCs|jtd�d�dS(Ns%Includes 'single' and "double" quotess1"Includes 'single' and &quot;double&quot; quotes"(R R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_single_double_quoteattr	scCstdg�}dS(Nsxml.parsers.no_such_parser(R(R,R\((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_make_parsers(R3R4R_R`RaRbRcRdRfRgRhRiRjRk(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR^�s											tPrepareInputSourceTestcBsPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cCs8tj|_t|jd��}|jd�WdQXdS(NR=sThis was read from a file.(RERtfileR@RA(R,ttmp((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytsetUpscCstj|j�dS(N(RERFRm(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyRGscCs
tjd�S(NsThis is a byte stream.(R?RO(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytmake_byte_streamscCs1|j|�|j|j�|�|j�dS(N(tassertIsNotNoneR treadtclose(R,tstreamtcontent((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytcheckContent!s
cCs[t|j�}|j|j��t|�}|j|j��|j|j�d�dS(NsThis is a byte stream.(	R
RmRRRpR
tassertIsNonetgetCharacterStreamRvt
getByteStream(R,tsrctprep((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_byte_stream'scCsHt|j�}t|�}|j|j��|j|j�d�dS(NsThis was read from a file.(R
RmR
RwRxRvRy(R,RzR{((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_system_id1s
cCs<t|j�}|j|j��|j|j�d�dS(NsThis was read from a file.(R
RmRwRxRvRy(R,R{((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_string:scCs?t|j��}|j|j��|j|j�d�dS(NsThis is a byte stream.(R
RpRwRxRvRy(R,R{((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_binary_fileAs(
R3R4RoRGRpRvR|R}R~R(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyRls					
			s,<?xml version="1.0" encoding="iso-8859-1"?>
t
XmlgenTestcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZRS(cCsg|j�}t|�}|j�|jdi�|jd�|j�|j|j�td�dS(NR5s<doc></doc>(	tioclassRt
startDocumenttstartElementt
endElementtendDocumentR RJtstart(R,RLtgen((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_basicOs


cCst|j�}t|�}|j�|jdi�|jd�|jd�|j�|j|j�t	d�dS(NR5thuheis<doc>huhei</doc>(
R�RR�R�t
charactersR�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_contentYs



cCsw|j�}t|�}|j�|jdd�|jdi�|jd�|j�|j|j�t	d�dS(NttestRKR5s<?test data?><doc></doc>(
R�RR�tprocessingInstructionR�R�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_pies


cCst|j�}t|�}|j�|jdi�|jd�|jd�|j�|j|j�t	d�dS(NR5s<huhei&s<doc>&lt;huhei&amp;</doc>(
R�RR�R�R�R�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_content_escapeqs



cCs�|j�}t|�}|j�|jdidd6�|jdidd6�|jd�|jdidd6�|jd�|jdidd6�|jd�|jd�|j�|j|j�td�dS(	NR5t"tatet's'"s

	sK<doc a='"'><e a="'"></e><e a="'&quot;"></e><e a="&#10;&#13;&#9;"></e></doc>(	R�RR�R�R�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_attr_escape~s





cCs�d
}x�|D]�}|j�}t|d|�}|j�|jdid	d
6�|jd	�|jd�|j�|j|j�d|j	|d��q
WdS(Nsiso-8859-15sutf-8sutf-16besutf-16lesutf-32besutf-32leR6R5u€R�u:<?xml version="1.0" encoding="%s"?>
<doc a="€">€</doc>R8(siso-8859-15sutf-8sutf-16besutf-16lesutf-32besutf-32le(
R�RR�R�R�R�R�R RJR:(R,RPR6RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_encoding�s




cCs}|j�}t|dd�}|j�|jdidd6�|jd�|jd�|j�|j|j�d�dS(NR6tasciiR5u€R�sE<?xml version="1.0" encoding="ascii"?>
<doc a="&#8364;">&#8364;</doc>(	R�RR�R�R�R�R�R RJ(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_unencodable�s



cCst|j�}t|�}|j�|jdi�|jd�|jd�|j�|j|j�t	d�dS(NR5t s<doc> </doc>(
R�RR�R�tignorableWhitespaceR�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_ignorable�s



cCs�d}x�|D]�}|j�}t|d|�}|j�|jdid	d
6�|jd	j|��|jdj|��|jd�|j�|j	|j
�d|j|d
��q
WdS(Nsiso-8859-15sutf-8sutf-16besutf-16lesutf-32besutf-32leR6R5u€R�R�u;<?xml version="1.0" encoding="%s"?>
<doc a="€">€ </doc>R8(siso-8859-15sutf-8sutf-16besutf-16lesutf-32besutf-32le(R�RR�R�R�R:R�R�R�R RJ(R,RPR6RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_encoding_bytes�s 



cCs�|j�}t|�}|j�|jdt�|jtdfdi�|jddi�|jdd�|jtdfd�|jd�|j	�|j
|j�tdt�dS(Ntns1R5sns1:doctudocs/<ns1:doc xmlns:ns1="%s"><udoc></udoc></ns1:doc>(NR�(NR�(
R�RR�tstartPrefixMappingR.tstartElementNSR)tendElementNStendPrefixMappingR�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_ns�s


cCst|j�}t|�}|j�|jddidd6�|jdd�|j�|j|j�t	d�dS(NR�tctbs
<a b="c"></a>(NR�(NR�(NR�(
R�RR�R�R)R�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_1463026_1�s

cCs�|j�}t|�}|j�|jdd�|jddi�|jdd�|jd�|j�|j	|j
�td�dS(NtquxR�s<a xmlns="qux"></a>(R�R�(R�R�(R�RR�R�R)R�R�R�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_1463026_2�s


cCs�|j�}t|�}|j�|jdd�|jddidd6�|jd	d�|jd�|j�|j	|j
�td�dS(
NtmyR�R�R�R�s"<my:a xmlns:my="qux" b="c"></my:a>(squxR�(NR�(squxR�(R�RR�R�R�R)R�R�R�R RJR�(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_1463026_3�s


cCsutd�}t�}|jtt�|j�}t|�}|j|�|j|�|j	|j
�td�dS(Nsb<?xml version="1.0"?><a:g1 xmlns:a="http://example.com/ns"><a:g2 xml:lang="en">Hello</a:g2></a:g1>sM<a:g1 xmlns:a="http://example.com/ns"><a:g2 xml:lang="en">Hello</a:g2></a:g1>(RRt
setFeatureRtTrueR�RtsetContentHandlerRHR RJR�(R,ttest_xmltparserRLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_5027_1s		

cCs�|j�}t|�}|j�|jdd�|jd
di�idd6}|jdd|�|jd�|jd
d�|jdd�|jd�|j�|j	|j
�td	�dS(NR�shttp://example.com/nstg1tens$http://www.w3.org/XML/1998/namespacetlangtg2tHellosM<a:g1 xmlns:a="http://example.com/ns"><a:g2 xml:lang="en">Hello</a:g2></a:g1>(shttp://example.com/nsR�(s$http://www.w3.org/XML/1998/namespaceR�(shttp://example.com/nsR�(shttp://example.com/nsR�(shttp://example.com/nsR�(R�RR�R�R�R�R�R�R�R RJR�(R,RLR�t	lang_attr((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_5027_2%s




cCs3|j�}d�}||�|j|j�dS(NcSs*t|�}|j�|jdi�dS(NR5(RR�R�(toutR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytfuncCs
(R�R%tclosed(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_no_close_fileAs	
cCs�|j�}t|�}|jdidd6�|jd�|jd�|jdidd6�|jd�|j|j�d�dS(	Ntfoos1.0R�R�tbars2.0R�s+<foo a="1.0">Hello</foo><bar b="2.0"></bar>(R�RR�R�R�R RJ(R,RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_xmlgen_fragmentJs


(R3R4R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�Ns"	
			
								
					tStringXmlgenTestcBseZeZRS((R3R4RR�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�YstBytesIOXmlgenTestcBseZejZRS((R3R4R?ROR�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�\stWriterXmlgenTestcBseZdefd��YZRS(R�cBs eZejZeZd�ZRS(cCs
dj|�S(Nt(tjoin(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyRJds(R3R4tlisttappendRAtFalseR�RJ(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�`s	(R3R4R�R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�_stXMLFilterBaseTestcBseZd�ZRS(cCs�t�}t|�}t�}|j|�|j�|jdi�|jd�|jd�|jd�|j	�|j
|j�td�dS(NR5RuR�s<doc>content </doc>(
RRR	R�R�R�R�R�R�R�R RJR�(R,RLR�tfilter((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_filter_basicis		





(R3R4R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�hstExpatReaderTestcBs�eZd�Zed��Zddd��YZd�Zddd��YZd�Zde	fd	��YZ
d
�Zd�Zd�Z
d
�Zd�Zd�Zed��Zd�Zd�Zd�Zd�Zd�Zed��ZRS(cCsXt�}t�}t|�}|j|�|jtt��|j|j�t	�dS(N(
RRRR�RHR@tTEST_XMLFILER RJtxml_test_out(R,R�RLtxmlgen((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_binary_file�s		
cCs�tj}tjt|�|jtj|�t�}t�}t	|�}|j
|�|jt|��|j
|j�t�dS(N(REtTESTFN_UNICODEtshutiltcopyfileR�t
addCleanupRFRRRR�RHR@R RJR�(R,tfnameR�RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_file_unicode�s			
tTestDTDHandlercBs#eZd�Zd�Zd�ZRS(cCsg|_g|_dS(N(t
_notationst	_entities(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt__init__�s	cCs|jj|||f�dS(N(R�R�(R,tnametpublicIdtsystemId((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytnotationDecl�scCs |jj||||f�dS(N(R�R�(R,R�R�R�tndata((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pytunparsedEntityDecl�s(R3R4R�R�R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��s		cCs�t�}|j�}|j|�|jd�|jd�|jd�|jd�|jd�|j�|j|jd
g�|j|jdg�dS(Ns<!DOCTYPE doc [
s-  <!ENTITY img SYSTEM "expat.gif" NDATA GIF>
sW  <!NOTATION GIF PUBLIC "-//CompuServe//NOTATION Graphics Interchange Format 89a//EN">
s]>
s<doc></doc>tGIFs;-//CompuServe//NOTATION Graphics Interchange Format 89a//ENtimgs	expat.gif(R�s;-//CompuServe//NOTATION Graphics Interchange Format 89a//ENN(R�Ns	expat.gifR�(	RR�t
setDTDHandlertfeedRsR R�R)R�(R,R�thandler((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_dtdhandler�s	







tTestEntityResolvercBseZd�ZRS(cCs t�}|jtd��|S(Ns	<entity/>(R
RRR(R,R�R�tinpsrc((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt
resolveEntity�s	(R3R4R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��scCs�t�}|j|j��t�}|jt|��|jd�|jd�|jd�|jd�|j�|j|j	�t
d�dS(Ns<!DOCTYPE doc [
s#  <!ENTITY test SYSTEM "whatever">
s]>
s<doc>&test;</doc>s<doc><entity></entity></doc>(RtsetEntityResolverR�RR�RR�RsR RJR�(R,R�RL((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_entityresolver�s		




tAttrGatherercBseZd�Zd�ZRS(cCs
||_dS(N(t_attrs(R,R�R((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��scCs
||_dS(N(R�(R,R�tqnameR((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��s(R3R4R�R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��s	cCsMt�}|j�}|j|�|jd�|j�|j|j�dS(Ns<doc/>(RR�R�R�RsR-R�(R,R�tgather((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_attrs_empty�s	


cCsMt�}|j�}|j|�|jd�|j�|j|j�dS(Ns<doc attr='val'/>(RR�R�R�RsR2R�(R,R�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_attrs_wattr�s	


cCsPtd�}|j�}|j|�|jd�|j�|j|j�dS(Nis<doc/>(RR�R�R�RsR/R�(R,R�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_nsattrs_empty�s


cCs�td�}|j�}|j|�|jdt�|j�|j}|j|j�d�|j|j	�tdfg�|j
|j�gkp�|j�dgk�|jt|�d�|j
|j
tdf��|j|jtdf�d�|j|jtdfd�d�|j|j�tdfdfg�|j|j�dg�|j|jtdf�d�|j|tdfd�dS(Nis"<doc xmlns:ns='%s' ns:attr='val'/>Rsns:attrR0i(RR�R�R�R.RsR�R R!R"R1R#R$R&R(R*R+R(R,R�R�R((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_nsattrs_wattr�s$

	"%cCsRt�}t�}t|�}|j|�|jt�|j|j�t�dS(N(	RRRR�RHR�R RJR�(R,R�RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_inpsource_filenames		

cCsXt�}t�}t|�}|j|�|jtt��|j|j�t	�dS(N(
RRRR�RHR
R�R RJR�(R,R�RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_inpsource_sysids		
cCs�tj}tjt|�|jtj|�t�}t�}t	|�}|j
|�|jt|��|j
|j�t�dS(N(RER�R�R�R�R�RFRRRR�RHR
R RJR�(R,R�R�RLR�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt"test_expat_inpsource_sysid_unicode(s			
cCsnt�}t�}t|�}|j|�t�}|jtt��|j|�|j	|j
�t�dS(N(RRRR�R
RRR@R�RHR RJR�(R,R�RLR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt test_expat_inpsource_byte_stream7s		
	
cCsmt�}t|�}t�}|j|�|jd�|jd�|j�|j|j�td�dS(Ns<doc>s</doc>s<doc></doc>(	RRRR�R�RsR RJR�(R,RLR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_incrementalEs		



cCs�t�}t|�}t�}|j|�|jd�|jd�t�}t|�}|j|�|j�|jd�|jd�|jd�|j�|j|j�t	d�dS(Ns<doc>ttexts</doc>s<doc>text</doc>(
RRRR�R�tresetRsR RJR�(R,RLR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_incremental_resetQs		


	





cCs�t�}t|�}t�}|j|�|jd�|jd�|j�|j|j�d�|j|j	�d�|j|j
�d�dS(Ns<doc>s</doc>i(RRRR�R�RsR tgetSystemIdR)tgetPublicIdt
getLineNumber(R,RLR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_locator_noinfohs		



cCsht�}t|�}t�}|j|�|jt�|j|j�t�|j|j�d�dS(N(
RRRR�RHR�R R�R�R)(R,RLR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_locator_withinfovs		

cCs�tj}tjt|�|jtj|�t�}t|�}t	�}|j
|�|j|�|j|j
�|�|j|j�d�dS(N(RER�R�R�R�R�RFRRRR�RHR R�R�R)(R,R�RLR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt#test_expat_locator_withinfo_unicode�s			

(((R3R4R�trequires_unicode_filenamesR�R�R�R�R�RR�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��s(	
			
	
	
		
	
					
tErrorReportingTestcBs6eZd�Zd�Zd�Zddd��YZRS(cCs�t�}|jt��t�}|jtd��d}|j|�y|j|�|j�Wn)t	k
r�}|j
|j�|�nXdS(Ns<foo bar foobar>sa file name(RR�RR
RRRtsetSystemIdRHtfailRR R�(R,R�tsourceR�R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_inpsource_location�s		

cCset�}|jt��|jt|jtd��|j|j�d�|j|j	�d�dS(Ns<foo>ii(
RR�RRRRHRR tgetColumnNumberR�(R,R�((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_expat_incomplete�s
	cCs�ttdd|jdd���ttdd|jdd���ttdd|jdd���ttdd|jdd���dS(Ntmessagei(tstrRR)tDummyLocator(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_sax_parse_exception_str�sR	cBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs||_||_dS(N(t_linenot_colno(R,tlinenotcolno((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��s	cCsdS(Ntpubid((R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��scCsdS(Ntsysid((R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��scCs|jS(N(R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR��scCs|jS(N(R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�s(R3R4R�R�R�R�R(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR	�s
				((R3R4RRR
R	(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�s	
		t
XmlReaderTestcBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs|jti��dS(N(R-R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_attrs_empty�scCs|jtidd6��dS(NR0R(R2R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_attrs_wattr�scCs|jtii��dS(N(R/R(R,((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_nsattrs_empty�scCs�tidtdf6idtdf6�}|j|j�d�|j|j�tdfg�|j|j�dg�|jt|�d�|j|jtdf��|j|j	�tdfg�|j|j
tdf�d�|j|j
tdfd�d�|j|j�tdfdfg�|j|j�dg�|j|j
tdf�d�|j|jd�d�|j|jd�tdf�|j|tdfd�|j|jtdf�d�dS(NR0Rsns:attrii(RR.R R!R"R#R$R1R&R'R(R*R+RRRR(R,R((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_nsattrs_wattr�s""%cCs�ddl}|jj�}x3|jj�D]"}|jd�r+|j|=q+q+Wz/ddl}|jj}|j|j	d�Wd|jj
|�XdS(Ni����sxml.sxml.sax.expatreader(tsystmodulestcopyR't
startswithtxml.sax.expatreadertsaxtexpatreaderR R3tupdate(R,Rtold_modulestmodnametxmltmodule((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_sf_1511497scCs?td�}t�}ddlm}|j||j|�dS(Ntinvalidi����(R(RRRIRRRH(R,tsioR�R((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyttest_sf_1513611s	(R3R4RRRRR"R%(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyR�s				,	cCs)tttttttttt	t
�
dS(N(RR[RDR^RlR�R�R�R�RR(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt	test_main"st__main__(LRIRRRRRtImportErrortxml.sax.saxutilsRRRRR	R
RRtxml.sax.handlerRtxml.sax.xmlreaderR
RRt	cStringIORR?tgctos.pathtosR�ttest.test_supportttest_supportRERRRtunittestR�tTEST_XMLFILE_OUTR�tsupports_unicode_filenamestpathR�R:tTESTFN_ENCODINGtAttributeErrortUnicodeErrort	TypeErrorR�t
skipUnlessR�R.tTestCaseRR)R7R9R<RCRDR[R^RlR�R�R�R�R�R�R@RrR�R�RRR&R3(((sf/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sax.pyt<module>sf(
.

	5W48�	�>N