%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/multibytecodec_support.pyc

ó
Nêáac@s¥ddlZddlZddlZddlZddlZddlmZddlmZddl	m	Z	dd
d„ƒYZ
dejfd„ƒYZd	„Z
dS(iÿÿÿÿN(t
HTTPException(ttest_support(tStringIOtTestBasecBsÈeZdZdZdZdZdZdZdZ	dZ
d„Zd„Zd„Z
d„Zd„Zd	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(tiiuí»®cCs…|jdkr'tj|jƒ|_n|jj|_|jj|_|jj|_|jj	|_
|jj|_|jj|_dS(N(
tcodectNonetcodecstlookuptencodingtencodetdecodetstreamreadertreadertstreamwritertwritertincrementalencodertincrementaldecoder(tself((s7/usr/local/lib/python2.7/test/multibytecodec_support.pytsetUpscCs˜x‘tg|jD]}t|ƒjƒ^qŒD]a\}}|j|ƒd}|j||jdƒƒ|jr/|j||j|ƒdƒq/q/WdS(Nisutf-8(tzipttstringRt	readlinesRtassertEqualt
roundtriptestR
(Rtftnativetutf8tu((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_chunkcoding#s	2	c
Csx|jD]
\}}}t|tƒr4|j}n	|j}|r|||ƒd}||jkr³|jt|ƒtkt|ƒƒ|j||d||j	|||fƒq|jt|ƒtkt|ƒƒ|j||d||j	|||fƒq
|j
t|||ƒq
WdS(Nis%r.decode(%r, %r)=%r != %rs%r.encode(%r, %r)=%r != %r(t
codectestst
isinstancetbytesRR
t
assertTruettypetunicodeRR	tassertRaisestUnicodeError(Rtsourcetschemetexpectedtfunctresult((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_errorhandle+s$	""cCsC|jr|jdƒnd}|j|j|dƒddƒdS(Ns$encoding contains full ISO 10646 mapuଓଣୠ nd eggstxmlcharrefreplaceisଓଣୠ nd eggs(thas_iso10646tskipTestRR
(Rts((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_xmlcharrefreplaceBs	cs“|jr|jdƒnddlm‰‡fd†}tjd|ƒ|jrc|j\}}nd}d}|j|j|dƒd|ƒdS(	Ns$encoding contains full ISO 10646 mapiÿÿÿÿ(tcodepoint2namecs¦t|tƒs"td|ƒ‚ng}xe|j|j|j!D]M}t|ƒˆkru|jdˆt|ƒƒq?|jdt|ƒƒq?Wdj|ƒ|jfS(Nsdon't know how to handle %ru&%s;u&#%d;u(	RtUnicodeEncodeErrort	TypeErrortobjecttstarttendtordtappendtjoin(texctltc(R1(s7/usr/local/lib/python2.7/test/multibytecodec_support.pytxmlcharnamereplaceRsstest.xmlcharnamereplaceu«ℜ» = 〈ሴ〉s*«ℜ» = ⟨ሴ⟩i(	R-R.thtmlentitydefsR1Rtregister_errortxmlcharnametestRR
(RR=tsintsout((R1s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_customreplace_encodeLs		csn‡fd†}tjd|ƒxHdddggdtƒddfD]"‰|jt|j|jdƒqDWdS(Ncs
ˆ|jfS(N(R6(R:(tret(s7/usr/local/lib/python2.7/test/multibytecodec_support.pyt	myreplacehsstest.cjktestiiitstringR(RR?RR4R$R3R
tunmappedunicode(RRE((RDs7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_callback_wrong_objectsgs
+cCsyd„}tjd|ƒ|j|jd|jddƒdƒd„}tjd|ƒ|jt|j|jdƒdS(	NcSsdt|jƒfS(Nux(tlongR6(R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyREqsstest.cjktestuabcduefght	abcdxefghi	cSsdtjdfS(Nuxi(tsystmaxint(R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyREws(RJi	(RR?RR
RGR$t
IndexError(RRE((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_callback_long_indexps	
	cCs9d„}tjd|ƒ|jt|j|jdƒdS(NcSsdS(Nux(uxN(R(R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyRE~sstest.cjktest(RR?R$R3R
RG(RRE((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_callback_None_index}s	csS‡fd†‰dˆ_tjdˆƒ|j|jd|jddƒdƒdS(	Ncs3ˆjdkr"ˆjd8_dSd|jfSdS(NiiuREPLACEDuTERMINAL(uREPLACEDi(tlimitR6(R:(RE(s7/usr/local/lib/python2.7/test/multibytecodec_support.pyRE…sistest.cjktestuabcduefght4abcdREPLACEDabcdREPLACEDabcdREPLACEDabcdTERMINALefghi	(RQi	(RPRR?RR
RG(R((REs7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_callback_backward_index„s	cCsDd„}tjd|ƒ|j|jd|jddƒdƒdS(NcSsd|jdfS(NuREPLACEDi(R6(R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyRE’sstest.cjktestuabcduefghtabcdREPLACEDghi	(RSi	(RR?RR
RG(RRE((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_callback_forward_index‘s	cCs9d„}tjd|ƒ|jt|j|jdƒdS(NcSsdS(NuTERMid(uTERMid((R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyRE™sstest.cjktest(RR?R$RMR
RG(RRE((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_callback_index_outofbound˜s	cCsétjdƒ}xÓdgtddƒdddddgD]¨}|t|jdƒƒ}tƒ}|jƒ}xT|dk	rŽ|j|ƒ}n|jƒ}|s¤Pn|j|ƒ}|j	|ƒqpW|j
|jƒ|jd	ƒq9WdS(
Nsutf-8ii!i@i€iiii(Rt	getreaderRtrangeRRRtreadR
twriteRtgetvalue(Rt
UTF8Readertsizehinttistreamtostreamtencodertdatate((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_incrementalencoderŸs	cCsÑtjdƒ}x»ddgtddƒddddd	gD]}t|jd
ƒ}|tƒƒ}|jƒ}x9|j|ƒ}|sŒPqs|j|ƒ}|j	|ƒqsW|j
|jƒ|jdƒq<WdS(Nsutf-8iÿÿÿÿii!i@i€iiii(Rt	getwriterRRWRRRRXRRYRRZ(Rt
UTF8WriterR\R]R^tdecoderR`R((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_incrementaldecoder³scCsÄ|j}|jƒ}|jt|j|tƒd|_|j|j|tƒdƒ|jƒd„}t	j
d|ƒd|_|j|j|tƒdƒd|_|j|j|tƒdƒdS(NtignoreRcSs
d|jfS(Nucalled(R6(R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttempreplaceÎsstest.incremental_error_callbacktcalled(RGRR$R2R
tTrueterrorsRtresetRR?(RtinvRaRh((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyt&test_incrementalencoder_error_callbackÄs		
			cCstjdƒ}xëdddgD]Ú}xÑddgtddƒdd	d
ddgD]£}|jt|jd
ƒƒ}|tƒƒ}t||ƒ}xC||ƒ}|s«Pn|dkrÇ|j|ƒq•|j	|ƒq•W|j
|jƒ|jdƒqRWqWdS(Nsutf-8RXtreadlineRiÿÿÿÿii!i@i€iiii(RRcRRWR
RRtgetattrt
writelinesRYRRZ(RRdtnameR\R]R^R)R`((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_streamreaderØsc	Csd
}tjdƒ}x÷|D]ï}xædgtddƒddd	d
dgD]»}|t|jdƒƒ}|jtƒƒ}t||ƒ}x[|dk	rª||ƒ}n	|ƒ}|s½Pn|dkrÙ|j|ƒq|j	|ƒqW|j
|jƒ|jdƒqLWqWdS(NRXRoRsutf-8ii!i@i€iiii(RXRoR(RRVRRWRRRRpRqRYRRZ(	Rt	readfuncsR[RrR\R]R^R)R`((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_streamwriterës$
	N(t__name__t
__module__R	RRRRRR-R@RGRRR+R0RCRHRNRORRRTRURbRfRnRsRu(((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyRs0	
			
				
		
						tTestBase_MappingcBsheZgZgZgZgZd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd„Z
RS(cOs\tjj|||Žy|jƒjƒWn+ttfk
rW|jd|jƒnXdS(NsCould not retrieve (	tunittesttTestCaset__init__topen_mapping_filetclosetIOErrorRR.t
mapfileurl(Rtargstkw((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR{	s
cCstj|jƒS(N(Rtopen_urlresourceR(R((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR|scCs-|jjdƒr|jƒn
|jƒdS(Ns.xml(Rtendswitht_test_mapping_file_ucmt_test_mapping_file_plain(R((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_mapping_files
c		sÀd„‰‡fd†}i}|jƒ}x†|D]~}|sDPn|jdƒdjƒjƒ}t|ƒdkr{q4nt|dƒ}|dkrªt|d@ƒ}nÀ|dkrût|d	?ƒt|d
?d@ƒt|d?d@ƒt|d@ƒ}no|dkr:t|d
?ƒt|d?d@ƒt|d@ƒ}n0|d
kr4t|d?ƒt|d@ƒ}nq4||dƒ}|dks4||kr˜q4n|||<|j||ƒq4WWdQXdS(NcSstdt|dƒƒS(Ns	u'\U%08x'i(tevaltint(R<((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyt<lambda>Rcs&dj‡fd†|jdƒDƒƒS(Nuc3s|]}ˆ|ƒVqdS(N((t.0R<(t_unichr(s7/usr/local/lib/python2.7/test/multibytecodec_support.pys	<genexpr>st+(R9tsplit(R/(R‹(s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR‰Rt#iiiiÿiiiiiiiu�(R|RtstriptlenR‡tchrt
_testpoint(	Rtunichrsturt_waRtlineR`tcsetvaltcsetchtunich((R‹s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR…s2	
E3!
cCs’|jƒ}|jƒ}WdQXtjd|ƒ}xX|D]P\}}tt|dƒƒ}djd„|jƒDƒƒ}|j||ƒq:WdS(Ns'<a u="([A-F0-9]{4})" b="([0-9A-F ]+)"/>iRcss$|]}tt|dƒƒVqdS(iN(R‘Rˆ(RŠR<((s7/usr/local/lib/python2.7/test/multibytecodec_support.pys	<genexpr>As(	R|RXtretfindalltunichrRˆR9RR’(RRtucmdatatuctunitcodedR˜tcodech((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR„;scCs%x|jD]}|j|Œq
WdS(N(tsupmapsR’(Rtmapping((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyttest_mapping_supplementalDscCsò||f|jkrwy |j|j|jƒ|ƒWqwtk
rs}|jdt|ƒt|ƒ|jfƒqwXn||f|jkrîy |j|j	|jƒ|ƒWqîtk
rê}|jdt|ƒt|ƒ|jfƒqîXndS(Ns*Encoding failed while testing %s -> %s: %ss*Decoding failed while testing %s -> %s: %s(
tpass_enctestRR
R	R%tfailtreprtreasontpass_dectestR(RR—R˜R:((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR’Hs 	' 	c
Cs3x,|jD]!\}}}t|tƒr4|j}n	|j}|rt|tƒr²||j|ƒ}|jt|ƒtkt|ƒƒ|j	||d||j|||fƒq+||j|ƒ}|jt|ƒtkt|ƒƒ|j	||d||j|||fƒq
|j
t||j|ƒq
WdS(Ns%r.decode(%r, %r)=%r != %rs%r.encode(%r, %r)=%r != %r(RRR RR
R	R!R"R#RR$R%(RR&R'R(R)R*((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyR+Vs&	""(RvRwR¤R¨R¡RR{R|R†R…R„R£R’R+(((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyRxs				"				cCs™tjjtjjtƒdƒ}ttjj||dƒdƒ}|jƒ}WdQXttjj||dƒdƒ}|jƒ}WdQX||fS(Ntcjkencodingss.txttrbs	-utf8.txt(tostpathR9tdirnamet__file__topenRX(RrtdirRtencodedR((s7/usr/local/lib/python2.7/test/multibytecodec_support.pytload_teststringns!%%((RR«R™RKRythttplibRttestRRRRzRxR²(((s7/usr/local/lib/python2.7/test/multibytecodec_support.pyt<module>sõk

Zerion Mini Shell 1.0