%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/test_bytes.pyo

ó
Nêáac@s–dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlZej
jr¢d„Zn	d„Zdfd„ƒYZde	jfd„ƒYZd	efd
„ƒYZde	jfd„ƒYZd
e	jfd„ƒYZdejjejjfd„ƒYZdefd„ƒYZde	jfd„ƒYZd„Zedkr’eƒndS(sŸUnit tests for the bytes and bytearray types.

XXX This is a mess.  Common tests should be unified with string_tests.py (and
the latter should be modernized).
iÿÿÿÿNcs"tjˆƒ‡fd†ƒ}|S(Ncs0tjjdtfƒˆ||ŽSWdQXdS(Nt(ttestttest_supporttcheck_warningstBytesWarning(targstkw(tfunc(s+/usr/local/lib/python2.7/test/test_bytes.pytwrappers(t	functoolstwraps(RR((Rs+/usr/local/lib/python2.7/test/test_bytes.pytcheck_bytes_warningsscCs|S(N((R((s+/usr/local/lib/python2.7/test/test_bytes.pyRst	IndexablecBseZdd„Zd„ZRS(icCs
||_dS(N(tvalue(tselfR
((s+/usr/local/lib/python2.7/test/test_bytes.pyt__init__"scCs|jS(N(R
(R((s+/usr/local/lib/python2.7/test/test_bytes.pyt	__index__$s(t__name__t
__module__RR(((s+/usr/local/lib/python2.7/test/test_bytes.pyR!st
BaseBytesTestcBsÙeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
ed„ƒZd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d „Z#d!„Z$d"„Z%d#„Z&d$„Z'd%„Z(d&„Z)d'„Z*d(„Z+d)„Z,d*„Z-d+„Z.d,„Z/d-„Z0d.„Z1d/„Z2d0„Z3d1„Z4d2„Z5RS(3cCs?|jƒ}|jt|ƒ|jƒ|j|j|jƒdS(N(t	type2testtassertEqualttypet	__class__(Rtb((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_basics*scs9|jƒ‰|jtˆƒdƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd	†ƒ|jt‡fd
†ƒ|jt‡fd†ƒ|jt‡fd†ƒdS(
NicsˆdS(Ni(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyt<lambda>2RcsˆdS(Ni(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR3RcsˆtjS(N(tsystmaxint((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR4RcsˆtjdS(Ni(RR((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR5RcsˆdS(Ni
idlDG¨†dªrÓâÈYâ|gÄO¬s&YR5I(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR6RcsˆdS(Niÿÿÿÿ(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR7RcsˆdS(Niþÿÿÿ(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR8RcsˆtjS(N(RR((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR9RcsˆtjdS(Ni(RR((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR:RcsˆtjdS(Ni(RR((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR;RcsˆdS(Ni
idlDG¨†dªrÓâÈYâ|gÄO¬s&YR5IléÿÿÿDG¨†dªrÓâÈYâ|gÄO¬s&YR5I(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR<R(RRtlentassertRaisest
IndexError(R((Rs+/usr/local/lib/python2.7/test/test_bytes.pyttest_empty_sequence/scCs|jtdƒƒ}|jt|ƒdƒ|jt|ƒttdƒƒƒ|jdhƒ}|j|dƒ|jddhƒ}|jt|ƒd
dhƒ|jttdƒƒƒ}|jt|ƒdƒ|jt|ƒttdƒƒƒ|jd„tdƒDƒƒ}|jt|ƒdƒ|jt|ƒttdƒƒddd	…ƒd
dd„ƒY}|j|ƒƒ}|j|dƒdS(Nii*t*i+i-css|]}|dr|VqdS(iN((t.0ti((s+/usr/local/lib/python2.7/test/test_bytes.pys	<genexpr>Osi€iitScBseZd„ZRS(cSsd|S(Niii(iii((RR#((s+/usr/local/lib/python2.7/test/test_bytes.pyt__getitem__Us(RRR%(((s+/usr/local/lib/python2.7/test/test_bytes.pyR$Tss(i+i-(i-i+((RtrangeRRtlisttassertInttupletiter(RRR$((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_iterable>s ""/cCsv|jttdƒƒƒ}|jt|ƒdƒ|jt|ƒttdƒƒƒ|jdƒ}|j|dƒdS(Niiiis(iii(RR)R&RRR'(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_tupleZs
"cCs|jttdƒƒƒ}|jt|ƒdƒ|jt|ƒttdƒƒƒ|jdddgƒ}|j|dƒdS(Niiiis(RR'R&RR(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_listbs
"cCs”|jtƒtdƒtdƒtdƒgƒ}|jt|ƒddddgƒ|jt|jtdƒgƒ|jt|jtdƒgƒdS(Niiþiÿiiÿÿÿÿi(RRRR'Rt
ValueError(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_indexjs
"cCsŒ|jtjddddgƒƒ}|j|dƒ|jdƒ}|j|dƒdtfd„ƒY}|j|j|dƒƒdƒdS(NtBiiiscBseZd„ZRS(cSs
t‚dS(N(t	TypeError(R((s+/usr/local/lib/python2.7/test/test_bytes.pyRzs(RRR(((s+/usr/local/lib/python2.7/test/test_bytes.pyR0ystfoobar(RtarrayRtbytes(RtaR0((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_bufferqs$cCs·|j|jdƒdƒ|j|jdƒdƒ|j|jdƒdƒ|jt|jdƒ|j|jdd	ƒdƒ|j|jdƒdƒ|jt|jtjdƒdS(
NiRisisiÿÿÿÿt0tascii(RRRR.t
OverflowErrorRtmaxsize(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_ssizescCs{|jt|jdƒddd„ƒY}|jt|jdgƒ|jt|jdgƒ|jt|j|ƒgƒdS(NgtCcBseZRS((RR(((s+/usr/local/lib/python2.7/test/test_bytes.pyR<‹s((RR1RtNone(RR<((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_constructor_type_errors‰s
cCs|jt|jdgƒ|jt|jtjgƒ|jt|jtjdgƒ|jt|jtjdgƒ|jt|jd	gƒ|jt|jdgƒ|jt|jdgƒ|jt|jtjgƒ|jt|jtjdgƒ|jt|jd
gƒdS(Niÿÿÿÿiii
idiilDG¨†dªrÓâÈYâ|gÄO¬s&YR5IléÿÿÿDG¨†dªrÓâÈYâ|gÄO¬s&YR5IlDG¨†dªrÓâÈYâ|gÄO¬s&YR5I(RR.RRR(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_constructor_value_errors“s!! cCsxddd„ƒY}|jt|j|ƒƒ|jt|j|ƒgƒddd„ƒY}|jt|j|ƒƒdS(NtBadIntcBseZd„ZRS(cSsdddS(Nii((R((s+/usr/local/lib/python2.7/test/test_bytes.pyR£s(RRR(((s+/usr/local/lib/python2.7/test/test_bytes.pyR@¢stBadIterablecBseZd„ZRS(cSsdddS(Nii((R((s+/usr/local/lib/python2.7/test/test_bytes.pyt__iter__©s(RRRB(((s+/usr/local/lib/python2.7/test/test_bytes.pyRA¨s(((RtZeroDivisionErrorR(RR@RA((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_constructor_exceptionsŸs
cCsv|jdddgƒ}|jdddgƒ}|jddgƒ}|j||ƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒdS(Niii(RRt
assertTruetassertFalse(Rtb1tb2tb3((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_compare­s&cCs¾|j|jdƒdktƒ|j|jdƒdktƒ|j|jdƒdktƒ|j|jdƒdktƒ|j|jƒtƒktƒ|j|jƒtƒktƒdS(Nsabcuabcsabcsabcsabc(RRtFalsetunicodetTrue(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_compare_to_strÄscCsTtttdƒƒ}|j|ƒ}tt|ƒƒ}|jƒ|j||ƒdS(NtHello(R'tmaptordRtreversedtreverseR(RtinputRtoutput((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_reversedÏs

csŒ‡fd†}|dƒ}ˆj|d |dƒƒˆj|dd!|dƒƒˆj|dd!|dƒƒˆj|d|d	ƒƒˆj|dd
!|d	ƒƒˆj|dd!|d	ƒƒˆj|d |dƒƒˆj|d
d!|dƒƒˆj|dd!|dƒƒˆj|d|d	ƒƒˆj|dd
!|d	ƒƒˆj|dd!|d	ƒƒˆj|dd!|dƒƒdS(Ncsˆjtt|ƒƒS(N(RRPRQ(ts(R(s+/usr/local/lib/python2.7/test/test_bytes.pytby×ssHello, worldiROitellois, tworldiidiùÿÿÿiõÿÿÿiûÿÿÿiœÿÿÿ(R(RRXR((Rs+/usr/local/lib/python2.7/test/test_bytes.pyt
test_getsliceÖsc
Cs•ttdƒƒ}|j|ƒ}d}xg|D]_}xV|D]N}xE|dD]9}|j||||…|j||||…ƒƒqLWq;Wq.WdS(Niÿiiiiidiÿÿÿÿiþÿÿÿiáÿÿÿiœÿÿÿ(
iNiiiidiÿÿÿÿiþÿÿÿiáÿÿÿiœÿÿÿ(R'R&RR=R(RtLRtindiceststarttstoptstep((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_extended_getsliceês

cCsd}xBdD]:}|j||ƒ}|j||j|j|ƒƒƒq
W|jt|j|dƒ|j|ddƒ}|j||j|d dƒƒdS(	NuHello world
áˆ´å™¸éª¼í»°tutf8tutf16tlatin1tignoreiüÿÿÿsutf-8(RbRc(RRtencodeRtUnicodeEncodeError(RtsampletencR((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_encodingõs
&cCs²d}x9d
D]1}|j||ƒ}|j|j|ƒ|ƒq
Wd}|j|dƒ}|jt|jdƒ|j|jddƒdƒ|j|jddd	dƒdƒdS(NuHello world
ሴ噸骼\def0\def0RbRcuHello world
€ÂþÿRdResHello world
terrorstencoding(RbRc(RRtdecodeRtUnicodeDecodeError(RRhRiR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_decodeþs
cCs‡|jdƒ}|j||jƒƒ|jdƒ}|j||jdgdƒƒ|jdƒ}|j||jdgdƒƒdS(Nii
i'(RR(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_from_int
s csœ|jdƒ‰|jdƒ‰|jˆˆdƒ|jˆtdƒdƒ|jtdƒˆdƒ|jt‡fd†ƒ|jt‡fd†ƒdS(NtabctdeftabcdeftdefabccsˆdS(Nudef(((RG(s+/usr/local/lib/python2.7/test/test_bytes.pyRRcsdˆS(Nuabc(((RH(s+/usr/local/lib/python2.7/test/test_bytes.pyRR(RRR4RR1(R((RGRHs+/usr/local/lib/python2.7/test/test_bytes.pyttest_concatscs±xªd|jdƒfD]“‰|jˆddƒ|jˆddƒ|jˆddƒ|jt‡fd†ƒ|jt‡fd†ƒ|jttf‡fd	†ƒqWdS(
NRqit	abcabcabciRiÿÿÿÿcsˆdS(Ng…ëQ¸	@(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR RcsdˆS(Ng…ëQ¸	@(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR!RcsˆtjS(N(RR:((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR$R(RRRR1R9tMemoryError(R((Rs+/usr/local/lib/python2.7/test/test_bytes.pyttest_repeatscCs7|j|jdƒd|jtdƒgdƒƒdS(Ntxid(RRRQ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_repeat_1char&scsÛ|jdƒ‰|jtdƒˆƒ|jttdƒƒˆƒ|jdˆƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒxtt	fD]ø}|j|d	ƒˆƒ|j|dƒˆƒ|j|d
ƒˆƒ|j|dƒˆƒ|j|dƒˆƒ|j|d
ƒˆƒ|j|dƒˆƒ|j|dƒˆƒ|j|dƒˆƒ|j|dƒˆƒ|j|dƒˆƒqÛWdS(NRqR5iÈcs
dˆkS(Ni,(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR.Rcs
dˆkS(Niÿÿÿÿ(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR/Rcs
dˆkS(N(R=((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR0RcsttdƒƒˆkS(NR5(tfloatRQ((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR1Rcs
dˆkS(Nua(((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR2RRRtctabtbctactdtdabtabd(
RR(RQtinttassertNotInRR.R1R4t	bytearray(Rtf((Rs+/usr/local/lib/python2.7/test/test_bytes.pyt
test_contains)s*cCs;|jt|jjƒ|jt|jjdƒ|j|jjdƒ|jƒƒtdddgƒ}|j|jjdƒ|ƒ|j|jjdƒ|ƒ|j|jjdƒd	ƒ|jt|jjd
ƒ|jt|jjdƒ|jt|jjdƒ|jt|jjd
ƒ|jt|jjdƒdS(Niuii+i0u1a2B30u  1A 2B  30   u0000suaurtu1a b cduu12      34(RR1RtfromhexRR…R.(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_fromhex@s"cCs2|j|jdƒjgƒdƒ|j|jdƒjdgƒdƒx¼dgddgddgdddggD]}tt|j|ƒƒ}|j|jdƒj|ƒdƒ|j|jdƒjt|ƒƒdƒ|j|jdƒjt|ƒƒdƒqrW|j|jdƒjdd	gƒd
ƒdS(NRRqR5R~R}R|Rt.tcdsab.cd(RRtjoinR'RPR)R*(Rtlst((s+/usr/local/lib/python2.7/test/test_bytes.pyt	test_joinNs"%1"(,cCs^|jdƒ}|j|jdƒdƒ|j|jdƒdƒ|j|jdƒdƒdS(NtmississippiR#itssitwi(RRtcount(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_countYscCs|jdƒ}|j|jƒjdƒƒ|j|jdƒƒ|j|jdƒƒ|j|jdƒƒ|j|jdƒƒ|j|jdƒƒdS(Nthellotanythingthelththellowtha(RRFt
startswithRE(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_startswith_scCsš|jdƒ}|jtƒjdƒƒ|j|jdƒƒ|j|jdƒƒ|j|jdƒƒ|j|jdƒƒ|j|jdƒƒdS(NR”R•tllototwhellotno(RRFR…tendswithRE(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_endswithhscCs¸|jdƒ}|j|jdƒdƒ|j|jddƒdƒ|j|jdddƒdƒ|j|jdddƒdƒ|j|jd	ƒdƒ|j|jd
ƒdƒdS(NRRiiiiiiÿÿÿÿR‘t
mississippian(RRtfind(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyt	test_findqscCs™|jdƒ}|j|jdƒdƒ|j|jddƒdƒ|j|jdddƒdƒ|j|jdƒd	ƒ|j|jd
ƒd	ƒdS(NRRiiiiiR‘iÿÿÿÿR¢(RRtrfind(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_rfindzscCsq|jdƒ}|j|jdƒdƒ|j|jdƒdƒ|jt|jdƒ|jt|jdƒdS(NRZR‘itorlitwormtldo(RRtindexRR.(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_index‚s
cCsq|jdƒ}|j|jdƒdƒ|j|jdƒdƒ|jt|jdƒ|jt|jdƒdS(NRZR‘iR§iR¨R©(RRtrindexRR.(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_rindex‰s
cCsK|jdƒ}|j|jddƒdƒ|j|jddƒdƒdS(NRR#R5tmassassappaRRyt	mixixippi(RRtreplace(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_replace‘scCs&|jt|jdƒjddƒdS(Nsa bi R(RR1RR°(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_replace_int_error–scCsB|jt|jdƒjdƒ|jt|jdƒjdƒdS(Nsa bu (RR1Rtsplittrsplit(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_split_string_error™scCsB|jt|jdƒjdƒ|jt|jdƒjdƒdS(Nsa bi (RR1RR³R´(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_split_int_errorscCsex6dD].}|j|ƒ}|j|jƒ|gƒqW|jdƒ}|j|jƒdgƒdS(Nsabsabsabsabs		

s(sabsabsabsab(RRR³(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_split_unicodewhitespace¡s

cCs,|jdƒ}|j|jƒdgƒdS(Ns		

s(RRR´(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_rsplit_unicodewhitespace¨scCsE|jdƒ}|j|jdƒdƒ|j|jdƒdƒdS(	NRRtmitissippiR‘R(R¹RRº(RRR(RRt	partition(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_partition¬scCs^|jdƒ}|j|jdƒd	ƒ|j|jdƒd
ƒ|j|jdƒdƒdS(NRRtmissitippiR#t
mississippRR‘(R½RR¾(R¿R#R(RRR(RRt
rpartition(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_rpartition±scCsB|jt|jdƒjdƒ|jt|jdƒjdƒdS(Nsa bu (RR1RR»RÀ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_partition_string_error·scCsB|jt|jdƒjdƒ|jt|jdƒjdƒdS(Nsa bi (RR1RR»RÀ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_partition_int_error»scCssxlttjdƒD]W}xNdD]F}|j|ƒ}tj||ƒ}tj|ƒ}|j||ƒq!WqWdS(NiRR5Rqsÿab€sÿ(RR5Rqsÿab€sÿ(R&tpickletHIGHEST_PROTOCOLRtdumpstloadsR(RtprotoRtpstq((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_pickling¿s
cCs||j|jdƒjtdƒƒdƒ|j|jdƒjtdƒƒdƒ|j|jdƒjtdƒƒdƒdS(NRqRRR~R}(RRtstript
memoryviewtlstriptrstrip(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_strip_bytearrayÇs((cCsa|jt|jdƒjdƒ|jt|jdƒjdƒ|jt|jdƒjdƒdS(NRquac(RR1RRÌRÎRÏ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_strip_string_errorÌscCsa|jt|jdƒjdƒ|jt|jdƒjdƒ|jt|jdƒjdƒdS(Ns abc i (RR1RRÌRÎRÏ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_strip_int_errorÑscCsj|jt|jdƒjddƒ|jt|jdƒjddƒ|jt|jdƒjddƒdS(NRqii (RR1Rtcentertljusttrjust(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_xjust_int_errorÖs""cCsb|jdƒ}|jgtt|ƒƒD]}t|||d!ƒ^q(dddddgƒdS(NsA€ÿiiiAii€iÿ(RRR&RRQ(RRR#((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_ordÛs9cCsž|jdƒ}|jdƒ}|jdƒ}|jdƒ}|jdƒ}|jd|j|dƒƒ|jd|j|ddƒƒ|jd|j|ddƒƒ|jd	|j|ddƒƒ|jd|j|dƒƒ|jd|j|ddƒƒ|jd|j|ddƒƒ|jd	|j|ddƒƒ|jd|j|dƒƒ|jd|j|ddƒƒ|jd|j|ddƒƒ|jd	|j|ddƒƒ|jd|j|dƒƒ|jd|j|ddƒƒ|jd|j|ddƒƒ|jd	|j|ddƒƒ|jd|j|dƒƒ|jd
|j|ddƒƒ|jd
|j|ddƒƒ|jd	|j|ddƒƒ|jt|j	|dƒƒ|jt|j	|ddƒƒ|jt|j	|ddƒƒ|jt
|j	|ddƒƒ|jt|j|dƒƒ|jt|j|ddƒƒ|jt|j|ddƒƒ|jt
|j|ddƒƒdS(NR”tlR—RyRiiiþÿÿÿii(RRR£R=R¥RªR¬R’RMR RKRš(RRRØR—RyR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_none_argumentsàsBcCs|jdƒ}|jdƒ}|jtd|j|dddƒ|jtd|j|dddƒ|jtd|j|dddƒ|jtd|j|dddƒ|jtd|j|dddƒ|jtd|j	|dddƒ|jtd	|j
|dddƒdS(
NR”Rys\bfind\bs	\brfind\bs	\bindex\bs
\brindex\bs	\bcount\bs\bstartswith\bs\bendswith\b(RtassertRaisesRegexpR1R£R=R¥RªR¬R’RšR (RRRy((s+/usr/local/lib/python2.7/test/test_bytes.pyt*test_find_etc_raise_correct_error_messagess cCs6tjj|t|jƒtjj|t|jƒdS(N(RRtcheck_free_after_iteratingR*RRR(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_free_after_iteratings(6RRRR R+R,R-R/R6R;R>R?RDRJRRNRVR[RaRjRoRpRuRxRzR‡R‰RŽR“R›R¡R¤R¦R«R­R±R²RµR¶R·R¸R¼RÁRÂRÃRËRÐRÑRÒRÖR×RÙRÛRÝ(((s+/usr/local/lib/python2.7/test/test_bytes.pyR(sf								
	
																																												+	t
ByteArrayTestcBsïeZeZd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs|jtttƒƒdS(N(RR1thashR…(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_nohash&sc
CsKd}|ddt|ƒ}tjƒ}zñt|dƒ}|j|ƒWdQXt|dƒ"}tdƒ}|j|ƒ}WdQX|j|t|ƒƒd„|Dƒ}|jt|ƒt|ƒƒt|dƒ}|j|ƒWdQXt|dƒ}|j|j	ƒ|ƒWdQXWdyt
j|ƒWnt
jk
rEnXXdS(NsHello world
sitwbtrbcss|]}t|ƒVqdS(N(RQ(R"RW((s+/usr/local/lib/python2.7/test/test_bytes.pys	<genexpr>7s(
RttempfiletmktemptopentwriteR…treadintoRR'treadtostremoveterror(Rtshort_sampleRhttfnR†Rtntb_sample((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_bytearray_api)s( cCs|tdƒ}|j|jƒdƒ|j|dƒtdƒ}|jƒ|j|dƒtƒ}|jƒ|j|ƒdS(NR”tollehthello1t1olleh(R…RRSR=RF(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_reverseEs
	
cCsGd„}|dƒ}|jtjd|ƒ|dƒ|dƒgƒdS(NcSsttt|ƒƒS(N(R…RPRQ(RW((s+/usr/local/lib/python2.7/test/test_bytes.pyRXQssHello, worlds\w+RORZ(Rtretfindall(RRXR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_regexpsPs	cCs‹tdddgƒ}d|d<|j|tdddgƒƒd|d<|j|tdddgƒƒtdƒ|d<|j|tdddgƒƒyd|d<|jd	ƒWntk
rÄnXyd|d
<|jd	ƒWntk
rónXyd|d<|jdƒWntk
r"nXy!tdƒ|d<|jdƒWntk
rWnXyd|d<|jd
ƒWntk
r†nXdS(NiiiidiÈiÿÿÿÿi
isDidn't raise IndexErroriöÿÿÿisDidn't raise ValueErrorsDidn't raise TypeError(R…RRtfailRR.R=R1(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_setitemVs@










c
Cs”ttdƒƒ}|d=|j|ttddƒƒƒ|d=|j|ttddƒƒƒ|d=|j|tddddd	d
dgƒƒdS(Ni
iiiÿÿÿÿi	iiiiii(R…R&R(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_delitemxscCs?ttdƒƒ}|jt|ƒttdƒƒƒtdddddgƒ|dd+|j|tddddddddddg
ƒƒ|dd	5|j|tdddddgƒƒtddd
ddgƒ|dd+|j|ttdƒƒƒtd
dgƒ|dd+|j|tddd
d
ddddgƒƒddddg|dd+|j|ttdƒƒƒdddg|dd+|j|tddd
ddddddddddg
ƒƒd|d)|j|tddd
dddgƒƒtdƒ|d*|j|tddddddgƒƒg|dd+|j|tdddddgƒƒtdƒ|d)|j|tdddddgƒƒxXdd	dtdƒddddggggD])}|jtƒ||dd+WdQXqÅWxFdddgdd ggD])}|jtƒ||dd+WdQXqWdS(!Ni
iiiiiii	iûÿÿÿiiiidieiùÿÿÿiýÿÿÿi*tfooifiotuuuuiugPïâÖäKDustrgffffff@uaubiþiÿiiÿÿÿi(#(	R…R&RR'RÍtlongRR1R.(RRtelem((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_setslices8""4
%".=
((
%%4"cCsdddddddddd	d
f}xá|D]Ù}xÐ|D]È}x¿|dD]³}ttdƒƒ}t|ƒ}||||…}|jƒ|||||…<|||||…<|j|t|ƒƒ||||…=||||…=|j|t|ƒƒqLWq;Wq.WdS(
Niiiii,iMiÿÿÿÿiþÿÿÿiáÿÿÿiÔþÿÿiÿl(R=R'R&R…RSR(RR]R^R_R`R\Rtdata((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_extended_set_del_slice«s'


cCsRttdƒƒ}||d)|j|tttdƒƒttdƒƒƒƒdS(Nii(R…R&RR'(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_setslice_trap¿s
cCsœtdƒ}|}|d7}|j|dƒ|j||ƒ|j||kƒ|d7}|j|dƒy|d7}Wntk
rŠnX|jdƒdS(NRqRrRstxyzt	abcdefxyzus'bytes += unicode didn't raise TypeError(R…RRER1Rø(RRRG((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_iconcatÆs


cCsStdƒ}|}|d9}|j|dƒ|j||ƒ|j||kƒdS(NRqiRv(R…RRE(RRRG((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_irepeatÖs
cCsWtdƒ}|}|d9}|j|ddƒ|j||ƒ|j||kƒdS(NRyid(R…RRE(RRRG((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_irepeat_1charÞs
cCs”tƒ}|jƒ}|j|dkƒ|g}x\tdƒD]N}|d7}|jƒ}|j|t|ƒƒ||kr>|j|ƒq>q>WdS(NiidRy(R…t	__alloc__RER&t
assertGreaterRtappend(RRtalloctseqR#((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_allocæs		
csŒtƒ‰‡‡fd†}ˆj|ƒƒˆjtˆƒttddƒƒƒˆjtˆƒdƒˆjƒ}ˆj|tˆƒƒdS(Nc3s¬x¥tddƒD]”}|Vtˆƒ}ˆj|ttdt|ƒdƒƒƒˆjtˆƒt|ƒƒˆjtˆƒ|ƒˆjƒ}ˆj|tˆƒƒqWdS(Niid(R&R'RRtassertLessEqualRR	(R#R5R(RR(s+/usr/local/lib/python2.7/test/test_bytes.pytgôs)iidic(R…RRR'R&RRR	(RRR((RRs+/usr/local/lib/python2.7/test/test_bytes.pyttest_init_allocòs		%cCsúd}t|ƒ}|j|ƒ|j|||ƒ|j|d|ƒtdƒ}|jtt|dƒƒ|jd„|dDƒƒ|j||dƒ|j|d|ƒtdƒ}|jttt|dƒƒƒ|j||dƒ|j|d|ƒtdƒ}|jttt|dƒƒƒ|j||dƒ|j|d|ƒtdƒ}|jt|jdd	d
dgƒ|jt|jdd	d
dgƒ|jt	|ƒdƒtdƒ}|jt
td
ƒƒgƒ|j|d
ƒdS(NR”iRicss|]}t|ƒVqdS(N(RQ(R"Ry((s+/usr/local/lib/python2.7/test/test_bytes.pys	<genexpr>si2iûÿÿÿiiiiiÿÿÿÿR5(R…textendRRPRQR*R'RR.RR(RtorigR5((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_extends2
  ""cs†tdƒ‰ˆjtdƒƒ|jˆdƒˆjtdƒƒ|jˆdƒ|jt‡fd†ƒ|jt‡fd†ƒ|jt‡fd†ƒˆjtdƒƒˆjtd	ƒƒ|jˆd
ƒ|jt‡fd†ƒˆjttd
ƒƒƒ|jˆdƒtd
dddgƒ}|jdƒ|j|td
ddgƒƒ|jdƒ|j|td
dgƒƒdS(NR”RØthelotheocsˆjtdƒƒS(NRØ(RêRQ((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR%Rcs
ˆjdƒS(Ni(Rê((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR&Rcs
ˆjdƒS(Nue(Rê((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR'RRR—tecs
ˆjdƒS(Nue(Rê((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR,RRi~ii€i(R…RêRQRRR.R1R(RR|((Rs+/usr/local/lib/python2.7/test/test_bytes.pyttest_removes&

cs²tdƒ‰|jˆjƒtdƒƒ|jˆjdƒtdƒƒ|jˆjdƒtdƒƒ|jt‡fd†ƒ|jtd„ƒ|jtd	ƒjƒd
ƒdS(NRZR€iR‘iþÿÿÿtrcs
ˆjdƒS(Ni
(tpop((R(s+/usr/local/lib/python2.7/test/test_bytes.pyR<RcSs
tƒjƒS(N(R…R(((s+/usr/local/lib/python2.7/test/test_bytes.pyR=Rsÿiÿ(R…RRRQRR(R((Rs+/usr/local/lib/python2.7/test/test_bytes.pyttest_pop7scCs|jtd„ƒdS(NcSs
tƒjƒS(N(R…tsort(((s+/usr/local/lib/python2.7/test/test_bytes.pyRBR(RtAttributeError(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_nosortAscsÉtdƒ‰ˆjtdƒƒ|jˆdƒ|jˆjdƒdƒtƒ‰ˆjtdƒƒ|jtˆƒdƒ|jt‡fd†ƒtƒ‰ˆjttdƒƒƒ|jˆdƒdS(NthellRR”idtAics
ˆjdƒS(Nuo(R
((R(s+/usr/local/lib/python2.7/test/test_bytes.pyRLR(	R…R
RQRR=RRR1R(R((Rs+/usr/local/lib/python2.7/test/test_bytes.pyttest_appendDs		cCs­tdƒ}|jdtdƒƒ|jdtdƒƒ|jdtdƒƒ|jdtdƒƒ|j|dƒtƒ}|jdttd	ƒƒƒ|j|d	ƒdS(
NtmssssppiR#iiþÿÿÿièRiR(R…tinsertRQRR(RR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_insertQs	cCstdƒ}|j||jdddƒkƒtgtdƒD]}|^q>ƒ}tdƒ}|j||j|ƒkƒdS(NRqtcdeiiR(R…RFR°R&t	translate(RRR#ttRy((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_copied^s
"%cCsVtdƒjdƒ\}}}|j|dƒ|j|dƒ|j||k	ƒ|d7}|j|dƒtdƒjdƒ\}}}|j|dƒ|j|dƒtdƒjdƒ\}}}|j|dƒ|j|dƒ|j||k	ƒ|d7}|j|dƒtdƒjdƒ\}}}|j|dƒ|j|dƒdS(NRytyRt!(R…R»RRERÀ(RR5RR|((s+/usr/local/lib/python2.7/test/test_bytes.pyt0test_partition_bytearray_doesnt_share_nullstringhs$

csYttdƒƒ‰tˆƒ}‡fd†}|dƒˆ}|jt|dƒ|jˆ|ƒ|jt|dƒ|jˆ|ƒ|jt|dƒ|jˆ|ƒ|jtˆjdƒ|jˆ|ƒ|jtˆjˆdƒ|jˆ|ƒ‡fd†}|jt|ƒ|jˆ|ƒ‡fd†}|jt|ƒ|jˆ|ƒdS(	Ni
cs&t|dd|dƒˆdd+dS(Niiiÿÿÿÿ(R&(Rî(R(s+/usr/local/lib/python2.7/test/test_bytes.pytresize„sii	iicsˆd=dS(Ni(((R(s+/usr/local/lib/python2.7/test/test_bytes.pytdelitem“scsdˆddd…<dS(NRiiÿÿÿÿi(((R(s+/usr/local/lib/python2.7/test/test_bytes.pytdelslice˜s(R…R&RÍRtBufferErrorRRRê(RtvR+RR,R-((Rs+/usr/local/lib/python2.7/test/test_bytes.pyttest_resize_forbidden}s*
cCs|jtttdƒƒdS(NR(RR.RƒR…(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_empty_bytearrayscCs°|jdddgƒ}t|ƒ}t|ƒ}x|D]}t|ƒq7W|jdƒ|jt|ƒgƒ|jt|ƒdgƒ|j||jddddgƒƒdS(Niiii	(RR*tnextR
RR'(RR5texhittempitRy((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_exhausted_iterator£s

(RRR…RRàRðRôR÷RùRúRÿRRRRRR
RRRRRR R#R'R*R0R1R5(((s+/usr/local/lib/python2.7/test/test_bytes.pyRÞ#s4					"			*										
		
	
	
		 	tAssortedBytesTestcBsqeZed„ƒZd„Zejjd„ƒZd„Z	ed„ƒZ
d„Zd„Zd„Z
d„ZRS(	cCs½x¶ttfD]¨}|j|tƒƒdƒ|j|tdgƒƒdƒ|j|tddddgƒƒdƒ|j|dƒd	ƒ|j|d
ƒdƒ|j|dƒd
ƒq
WdS(Nsbytearray(b'')isbytearray(b'\x00')iiþiÿsbytearray(b'\x00\x01\xfe\xff')Rqsb'abc't'sb"'"s'"sb'\'"'(tstrtreprRR…(RR†((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_repr_str³s!cCs¤|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jdtdƒktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒ|jtdƒdktƒdS(NRqR}(RR4RMRK(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_compare_bytes_to_bytearray¾s0cCsb|jtjƒ|jtjjdƒtjƒ|jtjƒ|jtjjdƒtjƒdS(Ns
bytearray(sbytes((tassertIsNotNoneR…t__doc__RERšR4(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_docÛscCs>tdƒ}t|ƒ}t|ƒ}|j|t|ƒƒdS(NsHello world
€þÿ(R4RÍR…R(RRhtbufR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_from_bytearrayâscCsš|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jttdƒƒdƒ|jttdƒƒdƒ|jttdƒƒd	ƒdS(
NRsb''Rysb'x's€sb'\x80'sbytearray(b'')sbytearray(b'x')sbytearray(b'\x80')(RR8R…(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_to_strèscCs}d	d
ddg}x-|D]%\}}|j|t|dƒƒqWx4tddƒD]#}|jttdt|ƒƒqRWdS(
NsWonderful spamsWonderful spam toosª€s\xaa\x00\000\200slatin-1i€isb"%s"(sWonderful spamsWonderful spam(sWonderful spam toosWonderful spam too(sª€sª€(s\xaa\x00\000\200s\xaa\x00\000\200(RR…R&RtSyntaxErrortevaltchr(RttestsRRWR|((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_literalñs	cCsd}t|ƒ}ttddƒƒ}tdƒ|tdƒ<|j|dƒ}|j|dƒ|j|dƒ|j|dƒ}|j|dƒ|j|dƒ|jddƒ}|j|dƒ|jddƒ}|j|dƒ|jt|jddƒ|jt|jddƒdS(	NR”iiRRRØtheethllo(R…R&RQR%RR=RR1(RRtbatrosettaR|((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_translateþs cCs)|jdjtdƒƒddgƒdS(Nsa bt R5R(RR³RÍ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_split_bytearrayscCs)|jdjtdƒƒddgƒdS(Nsa bRLR5R(RR´RÍ(R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_rsplit_bytearrays(RRRR:R;RRtrequires_docstringsR>R@RARFRKRMRN(((s+/usr/local/lib/python2.7/test/test_bytes.pyR6®s				
		tBytearrayPEP3137TestcBseZd„Zd„ZRS(cCs
t|ƒS(N(R…(RRy((s+/usr/local/lib/python2.7/test/test_bytes.pytmarshal&scCs°|jdƒ}xSdD]K}t||ƒ}|dƒ}|j||ƒ|j||k	|dƒqWxDdD]<}t|ƒ}|j||ƒ|j||k	|dƒqlWdS(Nt1234tzfillRÕRÔRÓis" returned self on a mutable objectsval.split()[0]sval.rsplit()[0]sval.partition(".")[0]sval.rpartition(".")[2]sval.splitlines()[0]sval.replace("", "")s! returned val on a mutable object(RSRÕRÔRÓ(sval.split()[0]sval.rsplit()[0]sval.partition(".")[0]sval.rpartition(".")[2]sval.splitlines()[0]sval.replace("", "")(RQtgetattrRRERC(Rtvaltmethnametmethodtnewvaltexpr((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_returns_new_copy)s

(RRRQRZ(((s+/usr/local/lib/python2.7/test/test_bytes.pyRP%s	tByteArrayAsStringTestcBs;eZeZd„Zd„Zd„Zd„Zd„ZRS(cCsdS(N((R((s+/usr/local/lib/python2.7/test/test_bytes.pyR‡CscCsdS(N((R((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_expandtabsEscCsdS(N((R((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_upperGscCsdS(N((R((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_lowerIscCsdS(N((R((s+/usr/local/lib/python2.7/test/test_bytes.pyt	test_hashKs(	RRR…RR‡R\R]R^R_(((s+/usr/local/lib/python2.7/test/test_bytes.pyR[<s				tByteArraySubclasscBseZRS((RR(((s+/usr/local/lib/python2.7/test/test_bytes.pyR`PstByteArraySubclassTestcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs:|jtttƒƒ|jtƒtƒd\}}t|ƒt|ƒ}}|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||kƒ|j||k	ƒ|j||||ƒ|j||||ƒ|j||||ƒ|j|d|dkƒdS(Ntabcdtefghi(RbRc(REt
issubclassR`R…tassertIsInstanceR(RR5Rt_at_b((s+/usr/local/lib/python2.7/test/test_bytes.pyt
test_basicUscCs…tdƒ}tƒj|gƒ}|j||k	ƒ|jt|ƒtkt|ƒƒ|jdgƒ}|jt|ƒtkƒdS(NRb(R`R…RŒRER(Rts1ts2ts3((s+/usr/local/lib/python2.7/test/test_bytes.pyRŽms"cCs÷tdƒ}d|_tdƒ|_xÌttjdƒD]·}tjtj||ƒƒ}|jt	|ƒt	|ƒƒ|j
||ƒ|j
|j|jƒ|j
|j|jƒ|j
t|ƒt|ƒƒ|j
t|jƒt|jƒƒq8WdS(NRbi
Rci(R`RyR(R&RÄRÅRÇRÆtassertNotEqualtidRR(RR5RÈR((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_picklezs	cCsçtdƒ}d|_tdƒ|_x¼tjtjfD]¨}||ƒ}|jt|ƒt|ƒƒ|j||ƒ|j|j|jƒ|j|j|jƒ|jt|ƒt|ƒƒ|jt|jƒt|jƒƒq7WdS(NRbi
Rc(	R`RyR(tcopytdeepcopyRlRmRR(RR5tcopy_methodR((s+/usr/local/lib/python2.7/test/test_bytes.pyt	test_copy‡s	cCsadtfd„ƒY}|dddƒ}|j|dƒ|ddddƒ}|j|dƒdS(NtsubclasscBseZdd„ZRS(ic_stj|||ŽdS(N(R…R(RtnewargRtkwargs((s+/usr/local/lib/python2.7/test/test_bytes.pyR–s(RRR(((s+/usr/local/lib/python2.7/test/test_bytes.pyRs•sitsourceRbRt(R…R(RRsRy((s+/usr/local/lib/python2.7/test/test_bytes.pyttest_init_override”s
(RRRhRŽRnRrRw(((s+/usr/local/lib/python2.7/test/test_bytes.pyRaSs
		
	
	
cCstjjttttƒdS(N(RRtrun_unittestRÞR[RaRP(((s+/usr/local/lib/python2.7/test/test_bytes.pyt	test_mains
	t__main__(R=R3RéRõRRoR	RÄRãtunittestttest.test_supportRttest.string_teststflagst
bytes_warningRRtTestCaseRRÞR6RPtstring_testst
CommonTesttNonStringModuleTestR[R…R`RaRyR(((s+/usr/local/lib/python2.7/test/test_bytes.pyt<module>s8	ÿüÿŒwJ		

Zerion Mini Shell 1.0