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_copy.cpython-39.pyc

a

��g�g�@s�dZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZddlZddl
mZeeee	fZe
efZeeZGdd�dej�Zdd�Zed	kr�e��dS)
zUnit tests for the copy module.�N)�le�lt�ge�gt�eq�ne)�supportc@steZdZdd�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)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dcdd�Z4dedf�Z5dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:dqdr�Z;dsdt�Z<dudv�Z=dwdx�Z>dydz�Z?d{d|�Z@d}d~�ZAdd��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�S)��TestCopycCs&|�tjtj�|�ttjt��dS�N)�assertIs�copy�Error�errorZ
assertTrue�
issubclass�	Exception��self�r�*/usr/local/lib/python3.9/test/test_copy.py�test_exceptionsszTestCopy.test_exceptionscCsd}t�|�}|�||�dS�N�*)r�assertEqual�r�x�yrrr�test_copy_basics
zTestCopy.test_copy_basiccsJG�fdd�dt���d�}t�|�}|�|j|j�|�|j|j�dS)Ncs eZdZdd�Z�fdd�ZdS)z"TestCopy.test_copy_copy.<locals>.CcSs
||_dSr
��foo�rrrrr�__init__!sz+TestCopy.test_copy_copy.<locals>.C.__init__cs
�|j�Sr
rr��Crr�__copy__#sz+TestCopy.test_copy_copy.<locals>.C.__copy__N)�__name__�
__module__�__qualname__r r#rr!rrr" sr"r)�objectrr�	__class__rrrr!r�test_copy_copys

zTestCopy.test_copy_copycsPGdd�dt���fdd�}�d�}|�ttj|�t��|��t�|�}dS)Nc@seZdZdd�ZdS)z&TestCopy.test_copy_registry.<locals>.CcSst�|�}||_|Sr
�r'�__new__r��clsr�objrrrr+,s
z.TestCopy.test_copy_registry.<locals>.C.__new__N�r$r%r&r+rrrrr"+sr"cs�|jffSr
r�r.r!rr�pickle_C0sz-TestCopy.test_copy_registry.<locals>.pickle_Cr)r'�assertRaises�	TypeErrorr�copyreg�pickle�rr1rrrr!r�test_copy_registry*szTestCopy.test_copy_registrycsFG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)Ncs eZdZ�fdd�Zdd�ZdS)z'TestCopy.test_copy_reduce_ex.<locals>.Ccs��d�dS�N����append�r�proto��crr�
__reduce_ex__9s
z5TestCopy.test_copy_reduce_ex.<locals>.C.__reduce_ex__cSs|�d�dS�Nzshouldn't call this�Zfailrrrr�
__reduce__<sz2TestCopy.test_copy_reduce_ex.<locals>.C.__reduce__N�r$r%r&rArDrr?rrr"8sr"r9�r'rrr�rr"rrrr?r�test_copy_reduce_ex7s
zTestCopy.test_copy_reduce_excsFG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)NcseZdZ�fdd�ZdS)z$TestCopy.test_copy_reduce.<locals>.Ccs��d�dSr8r;rr?rrrDFs
z/TestCopy.test_copy_reduce.<locals>.C.__reduce__N�r$r%r&rDrr?rrr"Esr"r9rFrGrr?r�test_copy_reduceDs
zTestCopy.test_copy_reducecCs,Gdd�dt�}|�}|�tjtj|�dS)Nc@seZdZdd�ZdS)z"TestCopy.test_copy_cant.<locals>.CcSs|�d�rt|��t�||�S�NZ__reduce��
startswith�AttributeErrorr'�__getattribute__�r�namerrrrOQs
z3TestCopy.test_copy_cant.<locals>.C.__getattribute__N�r$r%r&rOrrrrr"Psr")r'r2rr
�rr"rrrr�test_copy_cantOszTestCopy.test_copy_cantcCs�Gdd�d�}Gdd�dt�}dd�}Gdd�dtjd	�}dd
tddd
dddddd|jdttd��td�tddd�||t|t	�g}|D]}|�
t�|�|�q�dS)Nc@seZdZdS)z*TestCopy.test_copy_atomic.<locals>.ClassicN�r$r%r&rrrr�Classic[srVc@seZdZdS)z+TestCopy.test_copy_atomic.<locals>.NewStyleNrUrrrr�NewStyle]srWcSsdSr
rrrrr�f_sz$TestCopy.test_copy_atomic.<locals>.fc@seZdZdS)z0TestCopy.test_copy_atomic.<locals>.WithMetaclassNrUrrrr�
WithMetaclassasrY��	metaclass.r��d���Q�	@TF��?�hello�helloሴsworld��
r9)r'�abc�ABCMeta�NotImplemented�__code__�bytes�range�slice�max�propertyrr)rrVrWrXrY�testsrrrr�test_copy_atomicZs�zTestCopy.test_copy_atomiccCsTgd�}t�|�}|�||�|�||�g}t�|�}|�||�|�||�dS)N�r9r\��rr�assertIsNotrrrr�test_copy_listks

zTestCopy.test_copy_listcCsNd}|�t�|�|�d}|�t�|�|�dddgf}|�t�|�|�dS)Nrorr9r\rp)rr�rrrrr�test_copy_tupleuszTestCopy.test_copy_tuplecCsVddd�}t�|�}|�||�|�||�i}t�|�}|�||�|�||�dS)Nr9r\�r�barrqrrrr�test_copy_dict}s


zTestCopy.test_copy_dictcCsVhd�}t�|�}|�||�|�||�t�}t�|�}|�||�|�||�dS�N>r9r\rp)rrrr�setrrrr�
test_copy_set�s

zTestCopy.test_copy_setcCs:thd��}|�t�|�|�t�}|�t�|�|�dSry)�	frozensetrrrtrrr�test_copy_frozenset�szTestCopy.test_copy_frozensetcCsVtd�}t�|�}|�||�|�||�t�}t�|�}|�||�|�||�dS)Nsabc)�	bytearrayrrrrrrrr�test_copy_bytearray�s

zTestCopy.test_copy_bytearraycCs,Gdd�d�}|d�}|�t�|�|�dS)Nc@seZdZdd�Zdd�ZdS)z*TestCopy.test_copy_inst_vanilla.<locals>.CcSs
||_dSr
rrrrrr �sz3TestCopy.test_copy_inst_vanilla.<locals>.C.__init__cSs|j|jkSr
r�r�otherrrr�__eq__�sz1TestCopy.test_copy_inst_vanilla.<locals>.C.__eq__N�r$r%r&r r�rrrrr"�sr"r�rrrSrrr�test_copy_inst_vanilla�szTestCopy.test_copy_inst_vanillacs0G�fdd�d���d�}|�t�|�|�dS)Ncs(eZdZdd�Z�fdd�Zdd�ZdS)z'TestCopy.test_copy_inst_copy.<locals>.CcSs
||_dSr
rrrrrr �sz0TestCopy.test_copy_inst_copy.<locals>.C.__init__cs
�|j�Sr
rrr!rrr#�sz0TestCopy.test_copy_inst_copy.<locals>.C.__copy__cSs|j|jkSr
rr�rrrr��sz.TestCopy.test_copy_inst_copy.<locals>.C.__eq__N)r$r%r&r r#r�rr!rrr"�sr"rr�rtrr!r�test_copy_inst_copy�szTestCopy.test_copy_inst_copycCs,Gdd�d�}|d�}|�t�|�|�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z.TestCopy.test_copy_inst_getinitargs.<locals>.CcSs
||_dSr
rrrrrr �sz7TestCopy.test_copy_inst_getinitargs.<locals>.C.__init__cSs|jfSr
rrrrr�__getinitargs__�sz>TestCopy.test_copy_inst_getinitargs.<locals>.C.__getinitargs__cSs|j|jkSr
rr�rrrr��sz5TestCopy.test_copy_inst_getinitargs.<locals>.C.__eq__N�r$r%r&r r�r�rrrrr"�sr"rr�rSrrr�test_copy_inst_getinitargs�sz#TestCopy.test_copy_inst_getinitargscCsZGdd�dt�}|d�}t�|�}|�||�|�||�|�||�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z-TestCopy.test_copy_inst_getnewargs.<locals>.CcSst�|�}||_|Sr
��intr+r�r-rrrrrr+�s
z5TestCopy.test_copy_inst_getnewargs.<locals>.C.__new__cSs|jfSr
rrrrr�__getnewargs__�sz<TestCopy.test_copy_inst_getnewargs.<locals>.C.__getnewargs__cSs|j|jkSr
rr�rrrr��sz4TestCopy.test_copy_inst_getnewargs.<locals>.C.__eq__N�r$r%r&r+r�r�rrrrr"�sr"r�r�r�assertIsInstancerrrrrGrrr�test_copy_inst_getnewargs�s	
z"TestCopy.test_copy_inst_getnewargscCs\Gdd�dt�}|dd�}t�|�}|�||�|�||�|�||�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z0TestCopy.test_copy_inst_getnewargs_ex.<locals>.CcSst�|�}||_|Sr
r�r�rrrr+�s
z8TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__new__cSsdd|jifS�Nrrrrrrr�__getnewargs_ex__�szBTestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__cSs|j|jkSr
rr�rrrr��sz7TestCopy.test_copy_inst_getnewargs_ex.<locals>.C.__eq__N�r$r%r&r+r�r�rrrrr"�sr"rrr�rGrrr�test_copy_inst_getnewargs_ex�s	

z%TestCopy.test_copy_inst_getnewargs_excCs,Gdd�d�}|d�}|�t�|�|�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z+TestCopy.test_copy_inst_getstate.<locals>.CcSs
||_dSr
rrrrrr �sz4TestCopy.test_copy_inst_getstate.<locals>.C.__init__cSs
d|jiS�Nrrrrrr�__getstate__�sz8TestCopy.test_copy_inst_getstate.<locals>.C.__getstate__cSs|j|jkSr
rr�rrrr��sz2TestCopy.test_copy_inst_getstate.<locals>.C.__eq__N�r$r%r&r r�r�rrrrr"�sr"rr�rSrrr�test_copy_inst_getstate�sz TestCopy.test_copy_inst_getstatecCs,Gdd�d�}|d�}|�t�|�|�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z+TestCopy.test_copy_inst_setstate.<locals>.CcSs
||_dSr
rrrrrr �sz4TestCopy.test_copy_inst_setstate.<locals>.C.__init__cSs|d|_dSr�r�r�staterrr�__setstate__�sz8TestCopy.test_copy_inst_setstate.<locals>.C.__setstate__cSs|j|jkSr
rr�rrrr��sz2TestCopy.test_copy_inst_setstate.<locals>.C.__eq__N�r$r%r&r r�r�rrrrr"�sr"rr�rSrrr�test_copy_inst_setstate�sz TestCopy.test_copy_inst_setstatecCsFGdd�d�}|d�}|�t�|�|�|d�}|�t�|�|�dS)Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z4TestCopy.test_copy_inst_getstate_setstate.<locals>.CcSs
||_dSr
rrrrrr �sz=TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__init__cSs|jSr
rrrrrr��szATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__getstate__cSs
||_dSr
rr�rrrr��szATestCopy.test_copy_inst_getstate_setstate.<locals>.C.__setstate__cSs|j|jkSr
rr�rrrr�sz;TestCopy.test_copy_inst_getstate_setstate.<locals>.C.__eq__N�r$r%r&r r�r�r�rrrrr"�sr"rgr�rSrrr� test_copy_inst_getstate_setstate�s
	z)TestCopy.test_copy_inst_getstate_setstatecCsd}t�|�}|�||�dSr)r�deepcopyrrrrr�test_deepcopy_basic
s
zTestCopy.test_deepcopy_basiccCsZg}||g}t�|�}|�||�|�||�|�|d|d�|�|d|d�dS�Nrr9)rr�rrrrrrrr�test_deepcopy_memos
zTestCopy.test_deepcopy_memocCs8Gdd�dt�}Gdd�d|d�}|�t�|�|�dS)Nc@seZdZdS)z/TestCopy.test_deepcopy_issubclass.<locals>.MetaNrUrrrr�Metasr�c@seZdZdS)z,TestCopy.test_deepcopy_issubclass.<locals>.CNrUrrrrr"!sr"rZ)�typerrr�)rr�r"rrr�test_deepcopy_issubclasssz!TestCopy.test_deepcopy_issubclasscsJG�fdd�dt���d�}t�|�}|�|j|j�|�|j|j�dS)Ncs"eZdZdd�Zd�fdd�	ZdS)z*TestCopy.test_deepcopy_deepcopy.<locals>.CcSs
||_dSr
rrrrrr 'sz3TestCopy.test_deepcopy_deepcopy.<locals>.C.__init__Ncs
�|j�Sr
r�r�memor!rr�__deepcopy__)sz7TestCopy.test_deepcopy_deepcopy.<locals>.C.__deepcopy__)N)r$r%r&r r�rr!rrr"&sr"r)r'rr�rr(rrrr!r�test_deepcopy_deepcopy%s

zTestCopy.test_deepcopy_deepcopycsPGdd�dt���fdd�}�d�}|�ttj|�t��|��t�|�}dS)Nc@seZdZdd�ZdS)z*TestCopy.test_deepcopy_registry.<locals>.CcSst�|�}||_|Sr
r*r,rrrr+2s
z2TestCopy.test_deepcopy_registry.<locals>.C.__new__Nr/rrrrr"1sr"cs�|jffSr
rr0r!rrr16sz1TestCopy.test_deepcopy_registry.<locals>.pickle_Cr)r'r2r3rr�r4r5r6rr!r�test_deepcopy_registry0szTestCopy.test_deepcopy_registrycsFG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)Ncs eZdZ�fdd�Zdd�ZdS)z+TestCopy.test_deepcopy_reduce_ex.<locals>.Ccs��d�dSr8r;r=r?rrrA?s
z9TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce_ex__cSs|�d�dSrBrCrrrrrDBsz6TestCopy.test_deepcopy_reduce_ex.<locals>.C.__reduce__NrErr?rrr">sr"r9�r'rr�rrrGrr?r�test_deepcopy_reduce_ex=s
z TestCopy.test_deepcopy_reduce_excsFG�fdd�dt�}g�|�}t�|�}|�||�|��dg�dS)NcseZdZ�fdd�ZdS)z(TestCopy.test_deepcopy_reduce.<locals>.Ccs��d�dSr8r;rr?rrrDLs
z3TestCopy.test_deepcopy_reduce.<locals>.C.__reduce__NrIrr?rrr"Ksr"r9r�rGrr?r�test_deepcopy_reduceJs
zTestCopy.test_deepcopy_reducecCs,Gdd�dt�}|�}|�tjtj|�dS)Nc@seZdZdd�ZdS)z&TestCopy.test_deepcopy_cant.<locals>.CcSs|�d�rt|��t�||�SrKrLrPrrrrOWs
z7TestCopy.test_deepcopy_cant.<locals>.C.__getattribute__NrRrrrrr"Vsr")r'r2rr
r�rSrrr�test_deepcopy_cantUszTestCopy.test_deepcopy_cantcCsnGdd�d�}Gdd�dt�}dd�}dddd	d
ddd
dd|j||tt�g}|D]}|�t�|�|�qRdS)Nc@seZdZdS)z.TestCopy.test_deepcopy_atomic.<locals>.ClassicNrUrrrrrVasrVc@seZdZdS)z/TestCopy.test_deepcopy_atomic.<locals>.NewStyleNrUrrrrrWcsrWcSsdSr
rrrrrrXesz(TestCopy.test_deepcopy_atomic.<locals>.frr\r]r^TFr_r`ra)r'rgrkrlrrr�)rrVrWrXrmrrrr�test_deepcopy_atomic`s
�zTestCopy.test_deepcopy_atomiccCsFddgdg}t�|�}|�||�|�||�|�|d|d�dS�Nr9r\rpr�rr�rrrrrrr�test_deepcopy_listms

zTestCopy.test_deepcopy_listcCsbg}|�|�t�|�}tD]}|�t|||�q|�||�|�|d|�|�t	|�d�dSr�)
r<rr��comparisonsr2�RecursionErrorrrrr�len�rrr�oprrr�test_deepcopy_reflexive_listts

z%TestCopy.test_deepcopy_reflexive_listcCsd}t�|�}|�||�dS�Nr�rr�rrrrr�test_deepcopy_empty_tuple~s
z"TestCopy.test_deepcopy_empty_tuplecCsFddgdf}t�|�}|�||�|�||�|�|d|d�dSr�r�rrrr�test_deepcopy_tuple�s

zTestCopy.test_deepcopy_tuplecCsd}t�|�}|�||�dS)N)�r9r\rpr�rrrr�!test_deepcopy_tuple_of_immutables�s
z*TestCopy.test_deepcopy_tuple_of_immutablescCspgf}|d�|�t�|�}tD]}|�t|||�q"|�||�|�|d|d�|�|dd|�dS�Nr)r<rr�r�r2r�rrrr�rrr�test_deepcopy_reflexive_tuple�s
z&TestCopy.test_deepcopy_reflexive_tuplecCsHddgdd�}t�|�}|�||�|�||�|�|d|d�dS)Nr9r\rprvrr�rrrr�test_deepcopy_dict�s

zTestCopy.test_deepcopy_dictcCszi}||d<t�|�}tD]}|�t|||�qtD]}|�t|||�q4|�||�|�|d|�|�	t
|�d�dS)Nrr9)rr��order_comparisonsr2r3�equality_comparisonsr�rrrrr�r�rrr�test_deepcopy_reflexive_dict�s
z%TestCopy.test_deepcopy_reflexive_dictcCs0i}g}t�||�}|�|t|�d|�dSr�)rr�r�id�rr�rrrrr�test_deepcopy_keepalive�sz TestCopy.test_deepcopy_keepalivecCsji}gd�}t�||�}|�||�|�t|�d�i}dg}t�||�}|�||�|�t|�d�dS)N)r9r\rp�r\r�)rr�rr�r�rrr�!test_deepcopy_dont_memo_immutable�sz*TestCopy.test_deepcopy_dont_memo_immutablecCsBGdd�d�}|dg�}t�|�}|�||�|�|j|j�dS)Nc@seZdZdd�Zdd�ZdS)z.TestCopy.test_deepcopy_inst_vanilla.<locals>.CcSs
||_dSr
rrrrrr �sz7TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__init__cSs|j|jkSr
rr�rrrr��sz5TestCopy.test_deepcopy_inst_vanilla.<locals>.C.__eq__Nr�rrrrr"�sr"r�rr�rrrrrGrrr�test_deepcopy_inst_vanilla�s


z#TestCopy.test_deepcopy_inst_vanillacsRG�fdd�d���dg�}t�|�}|�||�|�||�|�|j|j�dS)Ncs(eZdZdd�Z�fdd�Zdd�ZdS)z/TestCopy.test_deepcopy_inst_deepcopy.<locals>.CcSs
||_dSr
rrrrrr �sz8TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__init__cs�t�|j|��Sr
)rr�rr�r!rrr��sz<TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__deepcopy__cSs|j|jkSr
rr�rrrr��sz6TestCopy.test_deepcopy_inst_deepcopy.<locals>.C.__eq__N)r$r%r&r r�r�rr!rrr"�sr"rr�rrr!r�test_deepcopy_inst_deepcopy�s

z$TestCopy.test_deepcopy_inst_deepcopycCsNGdd�d�}|dg�}t�|�}|�||�|�||�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z2TestCopy.test_deepcopy_inst_getinitargs.<locals>.CcSs
||_dSr
rrrrrr �sz;TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__init__cSs|jfSr
rrrrrr��szBTestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__getinitargs__cSs|j|jkSr
rr�rrrr��sz9TestCopy.test_deepcopy_inst_getinitargs.<locals>.C.__eq__Nr�rrrrr"�sr"rr�rGrrr�test_deepcopy_inst_getinitargs�s

z'TestCopy.test_deepcopy_inst_getinitargscCslGdd�dt�}|dg�}t�|�}|�||�|�||�|�||�|�|j|j�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z1TestCopy.test_deepcopy_inst_getnewargs.<locals>.CcSst�|�}||_|Sr
r�r�rrrr+�s
z9TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__new__cSs|jfSr
rrrrrr��sz@TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__getnewargs__cSs|j|jkSr
rr�rrrr��sz8TestCopy.test_deepcopy_inst_getnewargs.<locals>.C.__eq__Nr�rrrrr"�sr"r�r�rr�r�rrrrrGrrr�test_deepcopy_inst_getnewargs�s	

z&TestCopy.test_deepcopy_inst_getnewargscCsnGdd�dt�}|dgd�}t�|�}|�||�|�||�|�||�|�|j|j�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z4TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.CcSst�|�}||_|Sr
r�r�rrrr+�s
z<TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__new__cSsdd|jifSr�rrrrrr�szFTestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__getnewargs_ex__cSs|j|jkSr
rr�rrrr�sz;TestCopy.test_deepcopy_inst_getnewargs_ex.<locals>.C.__eq__Nr�rrrrr"�sr"rrr�rGrrr� test_deepcopy_inst_getnewargs_ex�s	
z)TestCopy.test_deepcopy_inst_getnewargs_excCsNGdd�d�}|dg�}t�|�}|�||�|�||�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z/TestCopy.test_deepcopy_inst_getstate.<locals>.CcSs
||_dSr
rrrrrr sz8TestCopy.test_deepcopy_inst_getstate.<locals>.C.__init__cSs
d|jiSr�rrrrrr�sz<TestCopy.test_deepcopy_inst_getstate.<locals>.C.__getstate__cSs|j|jkSr
rr�rrrr�sz6TestCopy.test_deepcopy_inst_getstate.<locals>.C.__eq__Nr�rrrrr"
sr"rr�rGrrr�test_deepcopy_inst_getstates

z$TestCopy.test_deepcopy_inst_getstatecCsNGdd�d�}|dg�}t�|�}|�||�|�||�|�|j|j�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z/TestCopy.test_deepcopy_inst_setstate.<locals>.CcSs
||_dSr
rrrrrr sz8TestCopy.test_deepcopy_inst_setstate.<locals>.C.__init__cSs|d|_dSr�rr�rrrr�sz<TestCopy.test_deepcopy_inst_setstate.<locals>.C.__setstate__cSs|j|jkSr
rr�rrrr� sz6TestCopy.test_deepcopy_inst_setstate.<locals>.C.__eq__Nr�rrrrr"sr"rr�rGrrr�test_deepcopy_inst_setstates

z$TestCopy.test_deepcopy_inst_setstatecCs�Gdd�d�}|dg�}t�|�}|�||�|�||�|�|j|j�|g�}t�|�}|�||�|�||�|�|j|j�dS)Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z8TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.CcSs
||_dSr
rrrrrr *szATestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__init__cSs|jSr
rrrrrr�,szETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__getstate__cSs
||_dSr
rr�rrrr�.szETestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__setstate__cSs|j|jkSr
rr�rrrr�0sz?TestCopy.test_deepcopy_inst_getstate_setstate.<locals>.C.__eq__Nr�rrrrr")sr"rr�rGrrr�$test_deepcopy_inst_getstate_setstate(s	


z-TestCopy.test_deepcopy_inst_getstate_setstatecCsBGdd�d�}|�}||_t�|�}|�||�|�|j|�dS)Nc@seZdZdS)z0TestCopy.test_deepcopy_reflexive_inst.<locals>.CNrUrrrrr"?sr")rrr�rrrrGrrr�test_deepcopy_reflexive_inst>s
z%TestCopy.test_deepcopy_reflexive_instcCspGdd�dt�}t|d��}t�|�}|�||�|�||�|�|j|j�|�|j|j�|�|j|�dS)Nc@seZdZdS)z'TestCopy.test_deepcopy_range.<locals>.INrUrrrr�IHsr�rc)r�rirr�rrr�stopr�)rr�rrrrr�test_deepcopy_rangeGs
zTestCopy.test_deepcopy_rangecCsFGdd�dt�}|�}t�|�}|�||�t�|�}|�||�dS)Nc@seZdZdd�ZdS)z+TestCopy.test_reconstruct_string.<locals>.CcSsdS)Nr:rrrrrrDVsz6TestCopy.test_reconstruct_string.<locals>.C.__reduce__NrIrrrrr"Usr")r'rrr�rGrrr�test_reconstruct_stringTs

z TestCopy.test_reconstruct_stringcsXG�fdd�dt����}d|_t�|�}|�|j|j�t�|�}|�|j|j�dS)NcseZdZ�fdd�ZdS)z,TestCopy.test_reconstruct_nostate.<locals>.Ccs�dfSr�rrr!rrrD`sz7TestCopy.test_reconstruct_nostate.<locals>.C.__reduce__NrIrr!rrr"_sr"r)r'rrrr(r�rrr!r�test_reconstruct_nostate^s

z!TestCopy.test_reconstruct_nostatecsbG�fdd�dt����}dg|_t�|�}|�||�t�|�}|�||�|�|j|j�dS)Ncs eZdZ�fdd�Zdd�ZdS)z*TestCopy.test_reconstruct_state.<locals>.Ccs�d|jfSr���__dict__rr!rrrDksz5TestCopy.test_reconstruct_state.<locals>.C.__reduce__cSs|j|jkSr
r�r�rrrr�msz1TestCopy.test_reconstruct_state.<locals>.C.__eq__N�r$r%r&rDr�rr!rrr"jsr"r�r'rrrr�rrrrr!r�test_reconstruct_stateis

zTestCopy.test_reconstruct_statecsbG�fdd�dt����}dg|_t�|�}|�||�t�|�}|�||�|�|j|j�dS)Ncs(eZdZ�fdd�Zdd�Zdd�ZdS)z3TestCopy.test_reconstruct_state_setstate.<locals>.Ccs�d|jfSr�r�rr!rrrDysz>TestCopy.test_reconstruct_state_setstate.<locals>.C.__reduce__cSs|j�|�dSr
)r��updater�rrrr�{sz@TestCopy.test_reconstruct_state_setstate.<locals>.C.__setstate__cSs|j|jkSr
r�r�rrrr�}sz:TestCopy.test_reconstruct_state_setstate.<locals>.C.__eq__N)r$r%r&rDr�r�rr!rrr"xsr"rr�rrr!r�test_reconstruct_state_setstatews

z(TestCopy.test_reconstruct_state_setstatecCsDGdd�dt�}|�}||_t�|�}|�||�|�|j|�dS)Nc@seZdZdS)z.TestCopy.test_reconstruct_reflexive.<locals>.CNrUrrrrr"�sr")r'rrr�rrrrGrrr�test_reconstruct_reflexive�s
z#TestCopy.test_reconstruct_reflexivecs�G�fdd�dt���ddgdg�}t�|�}|�||�|�||�|�|d|d�t�|�}|�||�|�||�|�|d|d�dS)Ncs eZdZ�fdd�Zdd�ZdS)z&TestCopy.test_reduce_4tuple.<locals>.Ccs�d|jt|�fSr�)r��iterrr!rrrD�sz1TestCopy.test_reduce_4tuple.<locals>.C.__reduce__cSst|�t|�ko|j|jkSr
)�listr�r�rrrr��s
�z-TestCopy.test_reduce_4tuple.<locals>.C.__eq__Nr�rr!rrr"�sr"r9r\rpr)r�rrrrrr�rrr!r�test_reduce_4tuple�s

zTestCopy.test_reduce_4tuplecs�G�fdd�dt���dddgfdg�}t�|�}|�||�|�||�|�|d|d�t�|�}|�||�|�||�|�|d|d�dS)Ncs eZdZ�fdd�Zdd�ZdS)z&TestCopy.test_reduce_5tuple.<locals>.Ccs�d|jd|��fSr�)r��itemsrr!rrrD�sz1TestCopy.test_reduce_5tuple.<locals>.C.__reduce__cSst|�t|�ko|j|jkSr
)�dictr�r�rrrr��s
�z-TestCopy.test_reduce_5tuple.<locals>.C.__eq__Nr�rr!rrr"�sr"rr9r\)rwrp)r�rrrrrr�rrr!r�test_reduce_5tuple�s

zTestCopy.test_reduce_5tuplecCs<Gdd�dt�}|�}dg|_t�|�}|�|j|j�dS)Nc@seZdZdgZdS)z#TestCopy.test_copy_slots.<locals>.CrN�r$r%r&�	__slots__rrrrr"�sr"r)r'rrrrGrrr�test_copy_slots�s

zTestCopy.test_copy_slotscCsLGdd�dt�}|�}dg|_t�|�}|�|j|j�|�|j|j�dS)Nc@seZdZdgZdS)z'TestCopy.test_deepcopy_slots.<locals>.CrNr�rrrrr"�sr"r)r'rrr�rrrrGrrr�test_deepcopy_slots�s
zTestCopy.test_deepcopy_slotscCsxGdd�dt�}|ddid�}t�|�}|�||�|�|j|j�|�||�d|d<|�||�|�|j|j�dS)Ncs*eZdZd�fdd�	Z�fdd�Z�ZS)z/TestCopy.test_deepcopy_dict_subclass.<locals>.CNcs&|si}t|���|_t��|�dSr
)r��keys�_keys�superr )r�d�r(rrr �sz8TestCopy.test_deepcopy_dict_subclass.<locals>.C.__init__cs(t��||�||jvr$|j�|�dSr
)r��__setitem__r�r<)r�key�itemr�rrr��s
z;TestCopy.test_deepcopy_dict_subclass.<locals>.C.__setitem__)N)r$r%r&r r��
__classcell__rrr�rr"�sr"rr)r�r9rw)r�rr�rr�rr�assertNotEqualrGrrr�test_deepcopy_dict_subclass�s

z$TestCopy.test_deepcopy_dict_subclasscCs�Gdd�dt�}|ddgdg�}ddg|_t�|�}|�t|�t|��|�|j|j�|�|d|d�|�|j|j�dS)	Nc@seZdZdS)z+TestCopy.test_copy_list_subclass.<locals>.CNrUrrrrr"�sr"r9r\rpr��r)r�rrrrrGrrr�test_copy_list_subclass�s

z TestCopy.test_copy_list_subclasscCs�Gdd�dt�}|ddgdg�}ddg|_t�|�}|�t|�t|��|�|j|j�|�|d|d�|�|j|j�dS)	Nc@seZdZdS)z/TestCopy.test_deepcopy_list_subclass.<locals>.CNrUrrrrr"�sr"r9r\rpr�r�r)r�rrr�rrrrGrrr�test_deepcopy_list_subclass�s

z$TestCopy.test_deepcopy_list_subclasscCsJGdd�dt�}|gd��}|�t|�d�t�|�}|�t|�d�dS)Nc@seZdZdS)z,TestCopy.test_copy_tuple_subclass.<locals>.CNrUrrrrr"�sr"ro)�tuplerrrGrrr�test_copy_tuple_subclass�s

z!TestCopy.test_copy_tuple_subclasscCs~Gdd�dt�}|ddgdg�}|�t|�ddgdf�t�|�}|�t|�ddgdf�|�||�|�|d|d�dS)Nc@seZdZdS)z0TestCopy.test_deepcopy_tuple_subclass.<locals>.CNrUrrrrr"�sr"r9r\rpr)r�rrr�rrrGrrr�test_deepcopy_tuple_subclass�s
z%TestCopy.test_deepcopy_tuple_subclasscCs&Gdd�dt�}|�ttj|��dS)Nc@seZdZdd�ZdS)z-TestCopy.test_getstate_exc.<locals>.EvilStatecSstd��dS)Nzain't got no stickin' state)�
ValueErrorrrrrr�sz:TestCopy.test_getstate_exc.<locals>.EvilState.__getstate__N)r$r%r&r�rrrr�	EvilStatesr)r'r2r�r)rrrrr�test_getstate_excszTestCopy.test_getstate_exccCsJ|�t�t�t�dd�}|�t�|�|�dd�}|�t�|�|�dS)NcSs||Sr
r�rrrrrr	�z(TestCopy.test_copy_function.<locals>.foocSsdSr
rrrrr�<lambda>rz-TestCopy.test_copy_function.<locals>.<lambda>)rr�
global_foo�rrrwrrr�test_copy_functions
zTestCopy.test_copy_functioncCsJ|�t�t�t�dd�}|�t�|�|�dd�}|�t�|�|�dS)NcSs||Sr
rrrrrrrz,TestCopy.test_deepcopy_function.<locals>.foocSsdSr
rrrrrrrz1TestCopy.test_deepcopy_function.<locals>.<lambda>)rrr�rrrrr�test_deepcopy_functions
zTestCopy.test_deepcopy_functioncCsNGdd�dt�}|�}t�|�}||�}|�||�~||�}|�||�dS)Nc@seZdZdS)z"TestCopy._check_weakref.<locals>.CNrUrrrrr"sr")r'�weakref�refr)rZ_copyr"r.rrrrr�_check_weakrefs
zTestCopy._check_weakrefcCs|�tj�dSr
)rrrrrr�test_copy_weakref szTestCopy.test_copy_weakrefcCs|�tj�dSr
)rrr�rrrr�test_deepcopy_weakref#szTestCopy.test_deepcopy_weakrefc
s�Gdd�dt���fdd�td�D�\}}}}|�}|||<|||<t�|�}|�||�|�||�|�|||�|�|||�|�t|�d�~~t��|�t|�d�����}}	|	||<|�||�dS)Nc@seZdZdS)z(TestCopy._check_copy_weakdict.<locals>.CNrUrrrrr"'sr"csg|]
}���qSrr��.0�ir!rr�
<listcomp>)rz1TestCopy._check_copy_weakdict.<locals>.<listcomp>r�r\r9)	r'rirrrrr�r�
gc_collectZassertNotIn)
rZ	_dicttype�a�br@r��u�vrrrr!r�_check_copy_weakdict&s"
zTestCopy._check_copy_weakdictcCs|�tj�dSr
)rr	�WeakKeyDictionaryrrrr�test_copy_weakkeydict;szTestCopy.test_copy_weakkeydictcCs|�tj�dSr
)rr	�WeakValueDictionaryrrrr�test_copy_weakvaluedict>sz TestCopy.test_copy_weakvaluedictcs�Gdd�dt���fdd�td�D�\}}}}t��}|||<|||<t�|�}|�||�|�t|�d�|�	|||�|�	|||�|�||j
|j
�|�||j
|j
�~t��|�t|�d�dS)Nc@seZdZdd�ZdS)z-TestCopy.test_deepcopy_weakkeydict.<locals>.CcSs
||_dSr
�r�rrrrrr Csz6TestCopy.test_deepcopy_weakkeydict.<locals>.C.__init__N�r$r%r&r rrrrr"Bsr"csg|]}�|��qSrrrr!rrrErz6TestCopy.test_deepcopy_weakkeydict.<locals>.<listcomp>r�r\r9)
r'rir	rrr�r�rr�rrrrr)rrrr@r�rrrr!r�test_deepcopy_weakkeydictAs
z"TestCopy.test_deepcopy_weakkeydictcsGdd�dt���fdd�td�D�\}}}}t��}|||<|||<t�|�}|�||�|�t|�d�t	|�
�dd�d	�\\}}\}	}
|�||�|�|j|j�|�
||�|�|	|�|�|	j|j�|�
|
|�~~~	~
~t��|�t|�d
�dS)Nc@seZdZdd�ZdS)z/TestCopy.test_deepcopy_weakvaluedict.<locals>.CcSs
||_dSr
rrrrrr Wsz8TestCopy.test_deepcopy_weakvaluedict.<locals>.C.__init__Nrrrrrr"Vsr"csg|]}�|��qSrrrr!rrrYrz8TestCopy.test_deepcopy_weakvaluedict.<locals>.<listcomp>r�r\cSs
|djSr�r)Zpairrrrrarz6TestCopy.test_deepcopy_weakvaluedict.<locals>.<lambda>)r�r9)r'rir	rrr�r�rr��sortedr�rrrrrr)rrrr@r�rrrr�z�trr!r�test_deepcopy_weakvaluedictUs&
 z$TestCopy.test_deepcopy_weakvaluedictcCsTGdd�dt�}|�}|j|_t�|�}|�|j|j�|�|jj|�|��dS)Nc@seZdZdd�ZdS)z0TestCopy.test_deepcopy_bound_method.<locals>.FoocSsdSr
rrrrr�mosz2TestCopy.test_deepcopy_bound_method.<locals>.Foo.mN)r$r%r&r$rrrr�Foonsr%)r'r$rrr�rr�__self__)rr%rX�grrr�test_deepcopy_bound_methodms
z#TestCopy.test_deepcopy_bound_methodN)Pr$r%r&rrr)r7rHrJrTrnrsrurxr{r}rr�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�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr
rrrrr#r(rrrrr	s�





	




	

	
r	cCs||Sr
rrrrrryrr�__main__)�__doc__rr4r	rd�operatorrrrrrrZunittest�testrr�r�r�ZTestCaser	rr$�mainrrrr�<module>s( o

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