Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.222.248.107
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_bytes.pyc
�
?��cc@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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytwrappers(t	functoolstwraps(RR((Rs6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytcheck_bytes_warningsscCs|S(N((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRst	IndexablecBseZdd�Zd�ZRS(icCs
||_dS(N(tvalue(tselfR
((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt__init__"scCs|jS(N(R
(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt	__index__$s(t__name__t
__module__RR(((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt<lambda>2Rcs�dS(Ni(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR3Rcs�tjS(N(tsystmaxint((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR4Rcs�tjdS(Ni(RR((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR5Rcs�dS(Ni
idlDG��d�r���Y�|g�O�s&YR5I(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR6Rcs�dS(Ni����(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR7Rcs�dS(Ni����(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR8Rcs�tjS(N(RR((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR9Rcs�tjdS(Ni(RR((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR:Rcs�tjdS(Ni(RR((R(s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR<R(RRtlentassertRaisest
IndexError(R((Rs6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pys	<genexpr>Osi�iitScBseZd�ZRS(cSsd|S(Niii(iii((RR#((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt__getitem__Us(RRR%(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR$Tss(i+i-(i-i+((RtrangeRRtlisttassertInttupletiter(RRR$((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_from_tupleZs
"cCs|jttd���}|jt|�d�|jt|�ttd���|jdddg�}|j|d�dS(Niiiis(RR'R&RR(RR((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRzs(RRR(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR0ystfoobar(RtarrayRtbytes(RtaR0((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_from_ssizescCs{|jt|jd�ddd��Y}|jt|jdg�|jt|jdg�|jt|j|�g�dS(NgtCcBseZRS((RR(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR<�s((RR1RtNone(RR<((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR�s(RRR(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR@�stBadIterablecBseZd�ZRS(cSsdddS(Nii((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt__iter__�s(RRRB(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRA�s(((RtZeroDivisionErrorR(RR@RA((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_compare_to_str�scCsTtttd��}|j|�}tt|��}|j�|j||�dS(NtHello(R'tmaptordRtreversedtreverseR(RtinputRtoutput((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytby�ssHello, worldiROitellois, tworldiidi����i����i����i����(R(RRXR((Rs6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_extended_getslice�s

cCs�d}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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_decode�s
cCs�|jd�}|j||j��|jd�}|j||jdgd��|jd�}|j||jdgd��dS(Nii
i'(RR(RR((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRRcsd�S(Nuabc(((RH(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRR(RRR4RR1(R((RGRHs6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR Rcsd�S(Ng��Q�	@(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR!Rcs�tjS(N(RR:((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR$R(RRRR1R9tMemoryError(R((Rs6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_repeatscCs7|j|jd�d|jtd�gd��dS(Ntxid(RRRQ(R((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR.Rcs
d�kS(Ni����(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR/Rcs
d�kS(N(R=((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR0Rcsttd���kS(NR5(tfloatRQ((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR1Rcs
d�kS(Nua(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR2RRRtctabtbctactdtdabtabd(
RR(RQtinttassertNotInRR.R1R4t	bytearray(Rtf((Rs6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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(NR�R�iiiiii����R�t
mississippian(RRtfind(RR((s6/usr/local/python-2.7/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(NR�R�iiiiiR�i����R�(RRtrfind(RR((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_rindex�s
cCsK|jd�}|j|jdd�d�|j|jdd�d�dS(NR�R#R5tmassassappaR�Ryt	mixixippi(RRtreplace(RR((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_replace�scCs&|jt|jd�jdd�dS(Nsa bi R(RR1RR�(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_replace_int_error�scCsB|jt|jd�jd�|jt|jd�jd�dS(Nsa bu (RR1Rtsplittrsplit(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_split_string_error�scCsB|jt|jd�jd�|jt|jd�jd�dS(Nsa bi (RR1RR�R�(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_split_int_error�scCsex6dD].}|j|�}|j|j�|g�qW|jd�}|j|j�dg�dS(Nsabsabsabsabs		

s(sabsabsabsab(RRR�(RR((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_split_unicodewhitespace�s

cCs,|jd�}|j|j�dg�dS(Ns		

s(RRR�(RR((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_rsplit_unicodewhitespace�scCsE|jd�}|j|jd�d�|j|jd�d�dS(	NR�R�tmitissippiR�R(R�R�R�(R�RR(RRt	partition(RR((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_partition�scCs^|jd�}|j|jd�d	�|j|jd�d
�|j|jd�d�dS(NR�R�tmissitippiR#t
mississippRR�(R�R�R�(R�R#R(RRR�(RRt
rpartition(RR((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_rpartition�scCsB|jt|jd�jd�|jt|jd�jd�dS(Nsa bu (RR1RR�R�(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_partition_string_error�scCsB|jt|jd�jd�|jt|jd�jd�dS(Nsa bi (RR1RR�R�(R((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_strip_int_error�scCsj|jt|jd�jdd�|jt|jd�jdd�|jt|jd�jdd�dS(NRqii (RR1Rtcentertljusttrjust(R((s6/usr/local/python-2.7/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#((s6/usr/local/python-2.7/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�RyR�iii����ii(RRR�R=R�R�R�R�RMR�RKR�(RRR�R�RyR�((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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�(((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pys	<genexpr>7s(
RttempfiletmktemptopentwriteR�treadintoRR'treadtostremoveterror(Rtshort_sampleRhttfnR�Rtntb_sample((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_reverseEs
	
cCsGd�}|d�}|jtjd|�|d�|d�g�dS(NcSsttt|��S(N(R�RPRQ(RW((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRXQssHello, worlds\w+RORZ(Rtretfindall(RRXR((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt
test_setslice�s8""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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_extended_set_del_slice�s'


cCsRttd��}||d)|j|tttd��ttd����dS(Nii(R�R&RR'(RR((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_iconcat�s


cCsStd�}|}|d9}|j|d�|j||�|j||k�dS(NRqiRv(R�RRE(RRRG((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_irepeat�s
cCsWtd�}|}|d9}|j|dd�|j||�|j||k�dS(NRyid(R�RRE(RRRG((s6/usr/local/python-2.7/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#((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytg�s)iidic(R�RRR'R&RRR	(RRR((RRs6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pys	<genexpr>si2i����iiiii����R5(R�textendRRPRQR*R'RR.RR(RtorigR5((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR%Rcs
�jd�S(Ni�(R�((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR&Rcs
�jd�S(Nue(R�((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR'RR�R�tecs
�jd�S(Nue(R�((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR,RRi~ii�i�(R�R�RQRRR.R1R(RR|((Rs6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR<RcSs
t�j�S(N(R�R(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR=Rs�i�(R�RRRQRR(R((Rs6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_pop7scCs|jtd��dS(NcSs
t�j�S(N(R�tsort(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRBR(RtAttributeError(R((s6/usr/local/python-2.7/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(NthellR�R�idtAics
�jd�S(Nuo(R
((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRLR(	R�R
RQRR=RRR1R(R((Rs6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_appendDs		cCs�td�}|jdtd��|jdtd��|jdtd��|jdtd��|j|d�t�}|jdttd	���|j|d	�dS(
NtmssssppiR#ii����i�R�iR(R�tinsertRQRR(RR((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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|((s6/usr/local/python-2.7/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(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytresize�sii	iics�d=dS(Ni(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytdelitem�scsd�ddd�<dS(NRii����i(((R(s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pytdelslice�s(R�R&R�RtBufferErrorRRR�(RtvR+RR,R-((Rs6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_resize_forbidden}s*
cCs|jtttd��dS(NR(RR.R�R�(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_empty_bytearray�scCs�|jdddg�}t|�}t|�}x|D]}t|�q7W|jd�|jt|�g�|jt|�dg�|j||jddddg��dS(Niiii	(RR*tnextR
RR'(RR5texhittempitRy((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_exhausted_iterator�s

(RRR�RR�R�R�R�R�R�R�RRRRRR
RRRRRR R#R'R*R0R1R5(((s6/usr/local/python-2.7/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�((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_doc�scCs>td�}t|�}t|�}|j|t|��dS(NsHello world
����(R4R�R�R(RRhtbufR((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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|((s6/usr/local/python-2.7/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�iiRR�R�theethllo(R�R&RQR%RR=RR1(RRtbatrosettaR|((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_translate�s cCs)|jdjtd��ddg�dS(Nsa bt R5R(RR�R�(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_split_bytearrayscCs)|jdjtd��ddg�dS(Nsa bRLR5R(RR�R�(R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_rsplit_bytearrays(RRRR:R;RRtrequires_docstringsR>R@RARFRKRMRN(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR6�s				
		tBytearrayPEP3137TestcBseZd�Zd�ZRS(cCs
t|�S(N(R�(RRy((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_returns_new_copy)s

(RRRQRZ(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRP%s	tByteArrayAsStringTestcBs;eZeZd�Zd�Zd�Zd�Zd�ZRS(cCsdS(N((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR�CscCsdS(N((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_expandtabsEscCsdS(N((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt
test_upperGscCsdS(N((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt
test_lowerIscCsdS(N((R((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt	test_hashKs(	RRR�RR�R\R]R^R_(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR[<s				tByteArraySubclasscBseZRS((RR(((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/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((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyR�s(RRR(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRs�sitsourceRbRt(R�R(RRsRy((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyttest_init_override�s
(RRRhR�RnRrRw(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyRaSs
		
	
	
cCstjjtttt�dS(N(RRtrun_unittestR�R[RaRP(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt	test_main�s
	t__main__(R=R3R�R�RRoR	R�R�tunittestttest.test_supportRttest.string_teststflagst
bytes_warningRRtTestCaseRR�R6RPtstring_testst
CommonTesttNonStringModuleTestR[R�R`RaRyR(((s6/usr/local/python-2.7/lib/python2.7/test/test_bytes.pyt<module>s8	����wJ		
© 2025 GrazzMean