Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_operator.cpython-39.opt-2.pyc

a

��g�_�@sJddlZddlZddlZddlmZejddgd�Zejddgd�ZGdd�d�ZGd	d
�d
e	�Z
Gdd�d�ZGd
d�d�ZGdd�deej
�Ze�ed�Gdd�deej
��ZGdd�d�ZGdd�deej
�Ze�ed�Gdd�deej
��Ze�ed�Gdd�deej
��Ze�ed�Gdd�deej
��Zedk�rFe��dS)�N)�support�operator�	_operator)Zblocked)Zfreshc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�Seq1cCs
||_dS�N��lst��selfr�r�./usr/local/lib/python3.9/test/test_operator.py�__init__sz
Seq1.__init__cCs
t|j�Sr��lenr�r
rrr�__len__
szSeq1.__len__cCs
|j|Srr�r
�irrr�__getitem__szSeq1.__getitem__cCs|j|jSrr�r
�otherrrr�__add__szSeq1.__add__cCs
|j|Srrrrrr�__mul__szSeq1.__mul__cCs
||jSrrrrrr�__rmul__sz
Seq1.__rmul__N�	�__name__�
__module__�__qualname__r
rrrrrrrrrr
src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�Seq2cCs
||_dSrrr	rrrr
sz
Seq2.__init__cCs
t|j�SrrrrrrrszSeq2.__len__cCs
|j|SrrrrrrrszSeq2.__getitem__cCs|j|jSrrrrrrrszSeq2.__add__cCs
|j|Srrrrrrr!szSeq2.__mul__cCs
||jSrrrrrrr#sz
Seq2.__rmul__Nrrrrrrsrc@seZdZdd�ZdS)�BadIterablecCst�dSr)�ZeroDivisionErrorrrrr�__iter__'szBadIterable.__iter__N)rrrr!rrrrr&src@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOS)P�OperatorTestCasecCs�|j}|�t|j�|�t|jdd�|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��dS�	Ny�?y@�r���?��@)�module�assertRaises�	TypeError�lt�assertFalse�
assertTrue�r
rrrr�test_lt,szOperatorTestCase.test_ltcCs�|j}|�t|j�|�t|jdd�|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��dSr#)r)r*r+�ler-r.r/rrr�test_le7szOperatorTestCase.test_lecCs�|j}Gdd�dt�}|�t|j�|�t|j|�|��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��dS)	Nc@seZdZdd�ZdS)z#OperatorTestCase.test_eq.<locals>.CcSst�dSr��SyntaxErrorrrrr�__eq__Esz*OperatorTestCase.test_eq.<locals>.C.__eq__N)rrrr5rrrr�CDsr6r$rr%r&r'r()r)�objectr*r+�eqr4r-r.�r
rr6rrr�test_eqBszOperatorTestCase.test_eqcCs�|j}Gdd�dt�}|�t|j�|�t|j|�|��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��dS)	Nc@seZdZdd�ZdS)z#OperatorTestCase.test_ne.<locals>.CcSst�dSrr3rrrr�__ne__Ssz*OperatorTestCase.test_ne.<locals>.C.__ne__N)rrrr;rrrrr6Rsr6r$rr%r&r'r()r)r7r*r+�ner4r.r-r9rrr�test_nePszOperatorTestCase.test_necCs�|j}|�t|j�|�t|jdd�|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��dSr#)r)r*r+�ger.r-r/rrr�test_ge^szOperatorTestCase.test_gecCs�|j}|�t|j�|�t|jdd�|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��|�|�dd��dSr#)r)r*r+�gtr.r-r/rrr�test_gtiszOperatorTestCase.test_gtcCsL|j}|�t|j�|�t|jd�|�|�d�d�|�|�d�d�dS)N���r$)r)r*r+�abs�assertEqualr/rrr�test_absts
zOperatorTestCase.test_abscCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)N���)r)r*r+�addrDr/rrr�test_add{szOperatorTestCase.test_addcCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)N��
)r)r*r+�and_rDr/rrr�test_bitwise_and�sz!OperatorTestCase.test_bitwise_andcCs�|j}|�t|j�|�t|jdd�|�|�dd�d�|�|�ddgddg�gd��|�|�td	d
g�tdg��gd��|�|�td	d
g�tdg��gd��|�t|jd
d�dS)N�pyZthonZpythonr$r'rFrG)r$r'rFrG��rH)rPrQrH�
�)r)r*r+�concatrDrrr/rrr�test_concat�s &&zOperatorTestCase.test_concatcCs�|j}|�t|j�|�t|jdd�|�t|jt�d�|�|�gd�d�d�|�|�gd�d�d�td�}|�|�||dg|�d�|�|�ididgi�d�dS)	Nr$)r$r'r$rFr$rGrFrPr�nan�r')r)r*r+�countOfr rrD�float�r
rrVrrr�test_countOf�szOperatorTestCase.test_countOfcCsV|j}gd�}|�t|j|�|�t|j|d�|�|�|d��|�|gd��dS)N�rGrFr'r$r$)rGr'r$)r)r*r+�delitem�assertIsNonerD�r
r�arrr�test_delitem�szOperatorTestCase.test_delitemcCs@|j}|�t|jd�|�t|jdd�|�|�dd�d�dS)NrPr')r)r*r+�floordivrDr/rrr�
test_floordiv�szOperatorTestCase.test_floordivcCs@|j}|�t|jd�|�t|jdd�|�|�dd�d�dS)NrPr'g@)r)r*r+�truedivrDr/rrr�test_truediv�szOperatorTestCase.test_truedivcCsF|j}td�}|�t|j�|�t|j|d�|�|�|d�d�dS)NrLr')r)�ranger*r+�getitemrDr_rrr�test_getitem�s
zOperatorTestCase.test_getitemcCs�|j}|�t|j�|�t|jdd�|�t|jt�d�|�|�gd�d�d�|�t|jgd�d�td�}|�|�||dg|�d�|�|�ididgi�d�dS)Nr$r\rFrrVrWr')	r)r*r+�indexOfr rrD�
ValueErrorrYrZrrr�test_indexOf�szOperatorTestCase.test_indexOfcCs:|j}|�t|j�|�t|jd�|�|�d�d�dS)NrG���)r)r*r+�invertrD�invr/rrr�test_invert�szOperatorTestCase.test_invertcCsd|j}|�t|j�|�t|jdd�|�|�dd�d�|�|�dd�d�|�t|jdd�dS)N�*rPr$rLrr'rB)r)r*r+�lshiftrDrjr/rrr�test_lshift�szOperatorTestCase.test_lshiftcCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)NrprPr'r$)r)r*r+�modrDr/rrr�test_mod�szOperatorTestCase.test_modcCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)NrPr'rL)r)r*r+�mulrDr/rrr�test_mul�szOperatorTestCase.test_mulcCsJ|j}|�t|j�|�t|jdd�Gdd�d�}|�|�dd�dS)Nrpc@seZdZdd�ZdS)z'OperatorTestCase.test_matmul.<locals>.McSs|dS)Nr$rrrrr�
__matmul__�sz2OperatorTestCase.test_matmul.<locals>.M.__matmul__N)rrrrwrrrr�M�srx�))r)r*r+�matmulrD)r
rrxrrr�test_matmul�s
zOperatorTestCase.test_matmulcCsp|j}|�t|j�|�t|jd�|�|�d�d�|�|�d�d�|�|�d�d�|�|�d�d�dS�NrPrlr)r)r*r+�negrDr/rrr�test_neg�szOperatorTestCase.test_negcCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)NrLrPrK)r)r*r+�or_rDr/rrr�test_bitwise_or�sz OperatorTestCase.test_bitwise_orcCsp|j}|�t|j�|�t|jd�|�|�d�d�|�|�d�d�|�|�d�d�|�|�d�d�dSr|)r)r*r+�posrDr/rrr�test_pos�szOperatorTestCase.test_poscCsb|j}|�t|j�|�t|jdd�|�|�dd�d�|�t|jd�|�t|jddd�dS)NrFrP��r$r')r)r*r+�powrDr/rrr�test_pow�szOperatorTestCase.test_powcCsd|j}|�t|j�|�t|jdd�|�|�dd�d�|�|�dd�d�|�t|jdd�dS)NrprPr$r'rrB)r)r*r+�rshiftrDrjr/rrr�test_rshiftszOperatorTestCase.test_rshiftcCsj|j}|�t|j�|�t|jdd�|�t|jt�d�|�|�td�d��|�|�td�d��dS)Nr$rGr'rP)	r)r*r+�containsr rr.rfr-r/rrr�
test_containsszOperatorTestCase.test_containscCsr|j}ttd��}|�t|j|�|�t|j|dd�|�|�|dd��|�|gd��|�t|j|dd�dS)NrFrr')r'r$r'rG)	r)�listrfr*r+�setitemr^rD�
IndexErrorr_rrr�test_setitemszOperatorTestCase.test_setitemcCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)NrPr'rF)r)r*r+�subrDr/rrr�test_sub szOperatorTestCase.test_subcCs||j}Gdd�dt�}|�t|j�|�t|j|��|�|�d��|�|�dg��|�|�d��|�|�g��dS)Nc@seZdZdd�ZdS)z&OperatorTestCase.test_truth.<locals>.CcSst�dSrr3rrrr�__bool__)sz/OperatorTestCase.test_truth.<locals>.C.__bool__N)rrrr�rrrrr6(sr6rPr)r)r7r*r+�truthr4r.r-r9rrr�
test_truth&szOperatorTestCase.test_truthcCs>|j}|�t|j�|�t|jdd�|�|�dd�d�dS)N��rH)r)r*r+�xorrDr/rrr�test_bitwise_xor2sz!OperatorTestCase.test_bitwise_xorcCs\|j}d}}|dd�|dd�}|�t|j�|�|�||��|�|�||��dS�NZxyzpdqrF)r)r*r+�is_r.r-�r
rr`�b�crrr�test_is8szOperatorTestCase.test_iscCs\|j}d}}|dd�|dd�}|�t|j�|�|�||��|�|�||��dSr�)r)r*r+�is_notr-r.r�rrr�test_is_not@szOperatorTestCase.test_is_notcCs|j}Gdd�d�}|�}d|_|�d�}|�||�d�|�t|�|�t||d�|jt||dd�|�d�}|�t||�|�t|jd�|�t|j�|�}d	|_d
|_d|_	|�|�dd
d�|�d�|�t|jd�Gdd�dt
�}|�t|�d�|��|�}d|_|�|_d|j_|�d�}|�||�d�|�t||j�|�dd�}|�||�d�|�ddd�}|�t||�|�d�}|�t||�|�d�}|�t||�|�|j_d|jj_|�d�}|�||�d�|�ddd�}|�||�d�dS)Nc@seZdZdS)z+OperatorTestCase.test_attrgetter.<locals>.AN�rrrrrrr�AJsr��arthur�nameZdent)ZsurnameZrankr'�X�Y�Z�x�z�y)r�r�r�)r�rr�c@seZdZdd�ZdS)z+OperatorTestCase.test_attrgetter.<locals>.CcSst�dSrr3�r
r�rrr�__getattr__asz7OperatorTestCase.test_attrgetter.<locals>.C.__getattr__N)rrrr�rrrrr6`sr6�foo�thomasz
child.name)r�r�zchild.child.namezchild.z.child�johnson)r�r�r�)
r)r��
attrgetterrDr*r+�AttributeErrorr�r�r�r7r4�child)r
rr�r`�f�recordr6rrr�test_attrgetterHsT







z OperatorTestCase.test_attrgettercCs|j}d}|�d�}|�||�d�|�t|�|�t||d�|jt||dd�|�d�}|�t||�Gdd�dt�}|�t|�d�|��|�d	�}|�t||�|�t|j�td
d�}|�d�}|�||�d
�|�d
�}|�t	||�gd�}|�d�}|�t
t||��gd��|�t||d�gd��t
tt
td���}|�|�ddd�|�d�|�t|�ddd�|�td�}	|�|�d�|	�d�|�|�tdd��|	�d�Gdd�dt�}
|�|�d�|
d��d�|�|�d�gd ��d�|�|�d�td!d"��d!�dS)#N�ABCDEr'r6rF)�sizerLc@seZdZdd�ZdS)z+OperatorTestCase.test_itemgetter.<locals>.CcSst�dSrr3r�rrrr�sz7OperatorTestCase.test_itemgetter.<locals>.C.__getitem__N)rrrrrrrrr6�srpr��val)�keyr�Znonkey)�ZapplerF�Zbananar'�ZpearrP�Zoranger$r$)rFr'rPr$)r�r�r�r��rP)�2Z10�5r�ZabcderB�erG)r��dc@seZdZdS)z+OperatorTestCase.test_itemgetter.<locals>.TNr�rrrr�T�sr�r�abcr`)r`r�r��d��)r)�
itemgetterrDr*r+r�r7r4�dict�KeyErrorr��map�sorted�strrf�tuple�slice)r
rr`r�r6r�Z	inventoryZgetcount�data�tr�rrr�test_itemgetter}sF






�z OperatorTestCase.test_itemgettercCs|j}|�t|j�|�t|jd�Gdd�d�}|�}|�d�}|�t||�|�ddd�}|�||�d�|�t|�|�t||d�|jt||dd�|�d	�}|�||�d
�|�t|||�|jd	dd�}|�||�d�|jd
ddd�}|�||�d�dS)Nr�c@s&eZdZdd�Zd	dd�Zdd�ZdS)
z-OperatorTestCase.test_methodcaller.<locals>.Ac_s|d|dS�Nrr$r�r
�args�kwdsrrrr��sz1OperatorTestCase.test_methodcaller.<locals>.A.foorpcSs|Srr�r
r�rrr�bar�sz1OperatorTestCase.test_methodcaller.<locals>.A.barc_s|d|dfS�Nr�r
r�r�r�rrr�baz�sz1OperatorTestCase.test_methodcaller.<locals>.A.bazN)rp�rrrr�r�r�rrrrr��s
r�r�r$r'rF)�spamr�rprP�r�r�r��eggs)r�r
)r�r�)r)r*r+�methodcallerr�rD)r
rr�r`r�rrr�test_methodcaller�s&

z"OperatorTestCase.test_methodcallercCs8|j}Gdd�dt�}|�}|�|�|d�d�|�|�|d�d�|�|�|d�d�|�|�|d�d�|�|�|d�d�|�|�|d�d	�|�|�	|d�d
�|�|�
|d�d�|�|�|d�d�|�|�|d�d
�|�|�
|d�d�|�|�|d�d�|�|�|d�d�|�|�||�d�dS)Nc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)z(OperatorTestCase.test_inplace.<locals>.CcSsdS)N�iaddrrrrr�__iadd__��z1OperatorTestCase.test_inplace.<locals>.C.__iadd__cSsdS)N�iandrrrrr�__iand__�r�z1OperatorTestCase.test_inplace.<locals>.C.__iand__cSsdS)N�	ifloordivrrrrr�
__ifloordiv__�r�z6OperatorTestCase.test_inplace.<locals>.C.__ifloordiv__cSsdS)N�ilshiftrrrrr�__ilshift__�r�z4OperatorTestCase.test_inplace.<locals>.C.__ilshift__cSsdS)N�imodrrrrr�__imod__�r�z1OperatorTestCase.test_inplace.<locals>.C.__imod__cSsdS)N�imulrrrrr�__imul__�r�z1OperatorTestCase.test_inplace.<locals>.C.__imul__cSsdS)N�imatmulrrrrr�__imatmul__�r�z4OperatorTestCase.test_inplace.<locals>.C.__imatmul__cSsdS)N�iorrrrrr�__ior__�r�z0OperatorTestCase.test_inplace.<locals>.C.__ior__cSsdS)N�ipowrrrrr�__ipow__�r�z1OperatorTestCase.test_inplace.<locals>.C.__ipow__cSsdS)N�irshiftrrrrr�__irshift__�r�z4OperatorTestCase.test_inplace.<locals>.C.__irshift__cSsdS)N�isubrrrrr�__isub__�r�z1OperatorTestCase.test_inplace.<locals>.C.__isub__cSsdS)N�itruedivrrrrr�__itruediv__�r�z5OperatorTestCase.test_inplace.<locals>.C.__itruediv__cSsdS)N�ixorrrrrr�__ixor__�r�z1OperatorTestCase.test_inplace.<locals>.C.__ixor__cSsdS)NrPrrrrrr�r�z4OperatorTestCase.test_inplace.<locals>.C.__getitem__N)rrrr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr6�sr6rPr�r�r�r�r�r�r�r�r�r�r�r�r�)r)r7rDr�r�r�r�r�r�r�r�r�r�r�r�r��iconcat)r
rr6r�rrr�test_inplace�s"zOperatorTestCase.test_inplacecCs8|j}Gdd�dt�}|�|�gd�d�|�|�tgd���d�|�|�|d��d�|�|�|t�d�d�|�|�|t�d�d�|�t��|�|d	��Wd�n1s�0Y|�t��|�|d
��Wd�n1s�0Y|�t	��|�|t	��Wd�n1�s*0YdS)Nc@seZdZdd�Zdd�ZdS)z,OperatorTestCase.test_length_hint.<locals>.XcSs
||_dSr)�value)r
r�rrrr
�sz5OperatorTestCase.test_length_hint.<locals>.X.__init__cSs t|j�tur|j�n|jSdSr)�typer�rrrr�__length_hint__�sz<OperatorTestCase.test_length_hint.<locals>.X.__length_hint__N)rrrr
r�rrrrr��sr�r'r)r$r'rFrFrGr�r����)
r)r7rD�length_hint�iter�NotImplementedr+r*rj�LookupError)r
rr�rrr�test_length_hint�s
,,z!OperatorTestCase.test_length_hintcCsZ|j}dd�t|�D�}|D]8}t||�}t|d|�d�dd�}|r|�||�qdS)NcSsg|]}|�d�s|�qS)�_)�
startswith)�.0r�rrr�
<listcomp>r�z<OperatorTestCase.test_dunder_is_original.<locals>.<listcomp>�__r)r)�dir�getattr�stripZassertIs)r
r�namesr�ZorigZdunderrrr�test_dunder_is_originals
z(OperatorTestCase.test_dunder_is_originalN)*rrrr0r2r:r=r?rArErJrNrUr[rarcrerhrkrorrrtrvr{r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr"+sN

				53!r"c@seZdZeZdS)�PyOperatorTestCaseN)rrr�py_operatorr)rrrrrsrzrequires _operatorc@seZdZeZdS)�COperatorTestCaseN)rrr�
c_operatorr)rrrrrsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�OperatorPickleTestCasecCs~t�tjd|j��t�||�}Wd�n1s40Yt�tjd|j��t�|�Wd�S1sp0YdS)Nr)	rZ	swap_item�sys�modulesr)�pickle�dumps�module2�loads)r
�obj�protoZpickledrrr�copys*zOperatorPickleTestCase.copyc	CsH|jj}Gdd�d�}|�}d|_d|_d|_|�|_|�|j_d|jj_tt	j
d�D]�}|j|d���|d	�}|�||�}|�
t|�t|��|�
||�||��|d	d
d�}|�||�}|�
t|�t|��|�
||�||��|d�}|�||�}|�
t|�t|��|�
||�||��Wd�qX1�s80YqXdS)
Nc@seZdZdS)z1OperatorPickleTestCase.test_attrgetter.<locals>.ANr�rrrrr� sr�r�r�r��Vr$�rr�r�r�zt.u.v)r)r�r�r�r�r��u�vrfr�HIGHEST_PROTOCOL�subTestrrD�repr)r
r�r�r`rr��f2rrrr�s.

z&OperatorPickleTestCase.test_attrgetterc	Cs�|jj}d}ttjd�D]�}|j|d���|d�}|�||�}|�t|�t|��|�||�||��|ddd�}|�||�}|�t|�t|��|�||�||��Wd�q1s�0YqdS)Nr�r$rr'rrG)	r)r�rfrr!r"rrDr#)r
r�r`rr�r$rrrr�:sz&OperatorPickleTestCase.test_itemgetterc	CsN|jj}Gdd�d�}|�}ttjd�D�]}|j|d���|d�}|�||�}|�t|�t|��|�||�||��|ddd�}|�||�}|�t|�t|��|�||�||��|ddd	�}|�||�}|�t|�t|��|�||�||��|d
ddd
�}|�||�}|�||�||��Wd�q*1�s>0Yq*dS)Nc@s&eZdZdd�Zd	dd�Zdd�ZdS)
z3OperatorPickleTestCase.test_methodcaller.<locals>.Ac_s|d|dSr�rr�rrrr�Lsz7OperatorPickleTestCase.test_methodcaller.<locals>.A.foorpcSs|Srrr�rrrr�Nsz7OperatorPickleTestCase.test_methodcaller.<locals>.A.barc_s|d|dfSr�rr�rrrr�Psz7OperatorPickleTestCase.test_methodcaller.<locals>.A.bazN)rpr�rrrrr�Ks
r�r$rr�r�r'rPr�r�r�r�r�)	r)r�rfrr!r"rrDr#)r
r�r�r`rr�r$rrrr�Is(z(OperatorPickleTestCase.test_methodcallerN)rrrrr�r�r�rrrrrsrc@seZdZeZeZdS)�PyPyOperatorPickleTestCaseN)rrrrr)rrrrrr%hsr%c@seZdZeZeZdS)�PyCOperatorPickleTestCaseN)rrrrr)rrrrrrr&lsr&c@seZdZeZeZdS)�CPyOperatorPickleTestCaseN)rrrrr)rrrrrrr'qsr'c@seZdZeZeZdS)�CCOperatorPickleTestCaseN)rrrrr)rrrrrr(vsr(�__main__)Zunittestrr�testrZimport_fresh_modulerrrr7rrr"ZTestCaserZ
skipUnlessrrr%r&r'r(r�mainrrrr�<module>s2g
Q





Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists