Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_ordered_dict.cpython-312.pyc

�

'Μgԟ�	���ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZmZddlmZej*ddg��Zej*ddg�	�Zej0d
��ZGd�d�ZGd
�d�ZGd�deej8�ZGd�dej8�Zdj?�D]Z e!ee e"ee ���[ Gd�d�Z#ejHed�Gd�dee#ej8��Z%Gd�de�Z&Gd�de%�Z'Gd�dej8�Z(ejHed�Gd�d ej8��Z)Gd!�d"ejT�Z+ejHed�Gd#�d$ejT��Z,Gd%�d&ejT�Z-ejHed�Gd'�d(ejT��Z.Gd)�d*�Z/Gd+�d,�Z0Gd-�d.e0ej8�Z1ejHed�Gd/�d0e0ej8��Z2e3d1k(rejh�yy)2�N)�	randrange�shuffle)�MutableMapping)�
mapping_tests�support)�
import_helper�collections�_collections)�blocked)�freshc#�K�tj|}|tj|<	d��|tj|<y#|tj|<wxYw�w�N)�sys�modules)�name�replacement�original_modules   �3/usr/local/lib/python3.12/test/test_ordered_dict.py�replaced_modulersF�����k�k�$�'�O�#�C�K�K���,�
�+����D���O����D��s�'A�A�A�A�Ac�P�eZdZd�Zd�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�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/�Z1d0�Z2e3jhd1��Z5y2)3�OrderedDictTestsc�.�|j}|jt�5|ddgd�ddd�gd�}|jt	|t|��j
��|�|jt	|d
it|���j
��|�|jt||�j
��|�|jt|gd�dd��j
��|�|jt|d�	�j
��d
g�|jt|d��j
��dg�|jt|d�|jt|d
d
�|jt|j�|gd��}|jddgdd��|jt|j
��gd��y#1swY���xYw)N��a���b��rr��c���d���e��rr)r!�	r#r"r(�r!r'�*��self)r.r,��other)r0r,��rrr )r$�,)r'�7r&��f��r%��gr$�rrr r#r&r5)r:r8)	�OrderedDict�assertRaises�	TypeError�assertEqual�sorted�dict�items�list�__init__)r.r<�pairsr$s    r�	test_initzOrderedDictTests.test_init$s����&�&��
�
�
�y�
)���8�,�d�3�*�B�������D��K� 8� >� >� @�A�5�I������ :�d�5�k� :� @� @� B�C�U�K�����k�%�0�6�6�8�9�5�A�����k�*R�,-��4�49�E�G�=�>C�	E�	
����k�r�2�8�8�:�;�l�^�L�����k��3�9�9�;�<�}�o�N����)�[�"�5����)�[�"�b�9����)�[�%9�%9�:�
�L�M��	�
�
�H�h�'�1��
�2�����a�g�g�i��R�	T�'*�
)�s�H
�
Hc��|j}gd�}t|�||�}|di|��}|jt|j	��|�y)Nr;r1)r<rr?rCrB)r.r<rB�argdictr$s     r�test_468zOrderedDictTests.test_468<sJ���&�&��V������e�$���"�'�"������a�g�g�i��%�0�c���|j}|jt�5|�jddgd�ddd�gd�}|�}|jt	|��|jt
|j��|�|�}|jdit	|���|jt
|j��|�|�}|j|�|jt|j��|�|�}|jgd�dd��|jt|j��|�|�}|jd�	�|jt|j��d
g�|�}|ji��|jt|j��difg�|�}|jdd
dd��|jt
t|j���gd��|gd��}|jddgdd��|jt|j��gd��|jt|�jd�|jt|�jdd�|jt|j�|jt|�jd�|jt|�jdd�|jt|j�y#1swY��(xYw)Nrrrr)r"r(r+�r-)r.rLr/r0r7r8�)�red�bluer0r.))rOr7)r0r8)rNr()r.rMr2r&r5r%r9r;r,r1)	r<r=r>�updaterAr?r@rBrC)r.r<rE�odr$s     r�test_updatezOrderedDictTests.test_updateDs����&�&��
�
�
�y�
)��M� � �(�H�!5�t�<�*�B��
�]��
�	�	�$�u�+���������
�+�U�3�
�]����	�	� �D��K� ��������
�+�U�3�
�]��
�	�	�%������b�h�h�j�)�5�1�
�]��
�	�	�:�a�1�	�E�����b�h�h�j�)�5�1��]��
�	�	�r�	������b�h�h�j�)�L�>�:�
�]��
�	�	��	������b�h�h�j�)�W�b�M�?�;�
�]��
�	�	�a�a�q�q�	�1������R�X�X�Z� 0�1�M�	O�

�L�M��	���(�H�%��a��0�����a�g�g�i��R�	T�	
���)�[�]�%9�%9�2�>����)�[�]�%9�%9�2�r�B����)�[�%7�%7�8����)�[�]�%9�%9�2�>����)�[�]�%9�%9�2�r�B����)�[�%7�%7�8�U*�
)�s�M"�"M,c�t��g�G�fd�d�}|j|��|j�dg�y)Nc�"��eZdZ�fd�Z�fd�Zy)�.OrderedDictTests.test_init_calls.<locals>.Spamc�(���jd�y)N�keysr1��append�r.�callss �rrWz3OrderedDictTests.test_init_calls.<locals>.Spam.keysus������V�$�rJc�(���jd�y)NrBr1rXrZs �rrBz4OrderedDictTests.test_init_calls.<locals>.Spam.itemsxs������W�%�rJN)�__name__�
__module__�__qualname__rWrB)r[s�r�SpamrUts
���
�
rJr`rW)r<r?)r.r`r[s  @r�test_init_callsz OrderedDictTests.test_init_callsrs6�����	�	�	
����� �������)rJc�J�|j}Gd�d|�}|�}d|d<y)Nc��eZdZd�Zy)�3OrderedDictTests.test_overridden_init.<locals>.ODNIc��yrr1)�args�kwargss  rrDz<OrderedDictTests.test_overridden_init.<locals>.ODNI.__init__�s��rJN)r]r^r_rDr1rJr�ODNIrd�s��
rJrhrr�r<)r.r<rhrQs    r�test_overridden_initz%OrderedDictTests.test_overridden_inits-���&�&��	�;�	��V����3�rJc��|j}|jd�}|jt|j	��dD�cgc]}|df��c}�|jdd��}|jt|j	��dD�cgc]}|df��c}�|jdd��}|jt|j	��dD�cgc]}|df��c}�ycc}wcc}wcc}w)N�abc��valuer)r<�fromkeysr?rCrB)r.r<rQr!s    r�
test_fromkeyszOrderedDictTests.test_fromkeys�s����&�&��
�
!�
!�%�
(������b�h�h�j�)�u�+E�u�!�Q��I�u�+E�F�
�
!�
!�%�t�
!�
4������b�h�h�j�)�u�+E�u�!�Q��I�u�+E�F�
�
!�
!�%�q�
!�
1������b�h�h�j�)�E�+B�E�q�Q��F�E�+B�C��	,F��+E��+Bs�C0
�C5
�C:
c��|j}|j|�t�|jt	|t��yr)r<�assertIsInstancer�
assertTrue�
issubclass)r.r<s  r�test_abczOrderedDictTests.test_abc�s2���&�&�����k�m�^�<����
�;��?�@rJc���|j}gd�}t|�||�}|jt|�t|��|j	�|jt|�d�y�N�)r!rr)rr"r#r&r5r)r<rr?�len�clear�r.r<rErQs    r�
test_clearzOrderedDictTests.test_clear�sX���&�&��L�����
��
������R��#�e�*�-�
���
�����R��!�$rJc��|j}gd�}||�}|d=|jd|�|jt�5|d=ddd�|j	t|j
��|dd|ddz�y#1swY�<xYw)Nrxrrr")r<�assertNotInr=�KeyErrorr?rCrBr{s    r�test_delitemzOrderedDictTests.test_delitem�s����&�&��L��
��
���s�G�����b�!�
�
�
�x�
(��3��)�����b�h�h�j�)�5��!�9�u�Q�R�y�+@�A�)�
(�s�B�Bc��|j}|gd��}d|d<d|d<|jt|j��gd��y)N)�r$rrr �rr%r&�
r!�r6)r�r)r!r�r�r&)r6r��r<r?rCrB�r.r<rQs   r�test_setitemzOrderedDictTests.test_setitem�sI���&�&��
�K�
L����3����3������b�h�h�j�)�W�	YrJc�L�|j}gd�}t|�||�}|jt|�|D�cgc]}|d��	c}�|jt|j	��|D�cgc]}|d��	c}�|jt|j��|D�cgc]}|d��	c}�|jt|j
��|�|jtt|��t|�D�cgc]}|d��	c}�|jtt|j	���t|�D�cgc]}|d��	c}�|jtt|j���t|�D�cgc]}|d��	c}�|jtt|j
���tt|���ycc}wcc}wcc}wcc}wcc}wcc}w)Nrxrr)r<rr?rCrW�valuesrB�reversed�r.r<rErQ�ts     r�test_iteratorszOrderedDictTests.test_iterators�s����&�&��L�����
��
������b��%�#8�%�Q�A�a�D�%�#8�9�����b�g�g�i���*?��A�1�Q�4��*?�@�����b�i�i�k�*�5�,A�5�a�Q�q�T�5�,A�B�����b�h�h�j�)�5�1�����h�r�l�+�(0���8��1�!�A�$��8�	:�����h�r�w�w�y�1�2�(0���8��1�!�A�$��8�	:�����h�r�y�y�{�3�4�(0���8��1�!�A�$��8�	:�����h�r�x�x�z�2�3�T�(�5�/�5J�K��$9��*?��,A��9��8��8s#�H
�7H
�1H
�H
�$H
�0H!
c���|j}|jd�}t|�}t|�}||=|j	t
�5t|�ddd�y#1swYyxYw)Nrl)r<ro�iter�nextr=�	Exception)r.r<rQ�it�keys     r�%test_detect_deletion_during_iterationz6OrderedDictTests.test_detect_deletion_during_iteration�sY���&�&��
�
!�
!�%�
(��
�"�X���2�h���s�G�
�
�
�y�
)�
��H�*�
)�
)�s�A!�!A*c
���|j}|jt�5|ddgd�ddd�gd�}||�}|jt	|�|D�cgc]}|d��	c}�|jt	|j��|D�cgc]}|d��	c}�|jt	|j
��|D�cgc]}|d��	c}�|jt	|j��|�|jt	t|��t	t|�D�cgc]}|d��	c}��y#1swY��'xYwcc}wcc}wcc}wcc}w)Nrrrrr)	r<r=r>r?r@rWr�rBr�r�s     r�test_sorted_iteratorsz&OrderedDictTests.test_sorted_iterators�s.���&�&��
�
�
�y�
)���8�,�d�3�*�B��
��
��������E�%:�E�q�a��d�E�%:�;��������	�*�5�,A�5�a�Q�q�T�5�,A�B������	�	��,�U�.C�U��q��t�U�.C�D��������
�+�U�3��������-��x��� ?��!��1��� ?�@�	B�*�
)��&;��,A��.C��!@s#�E�E 
�E%
�E*
�;E/�Ec���|j}|�}g}|jt|�|�|jt|j��|�|jt|j	��|�|jt|j��|�|jtt
|��|�|jtt
|j���|�|jtt
|j	���|�|jtt
|j���|�yr)r<r?rCrWr�rBr�)r.r<rQ�emptys    r�test_iterators_emptyz%OrderedDictTests.test_iterators_empty�s����&�&��
�]��������b��5�)�����b�g�g�i��%�0�����b�i�i�k�*�E�2�����b�h�h�j�)�5�1�����h�r�l�+�U�3�����h�r�w�w�y�1�2�E�:�����h�r�y�y�{�3�4�e�<�����h�r�x�x�z�2�3�U�;rJc�Z�|j}gd�}t|�||�}|r1|j|j�|j	��|r�1|jt�5|j�ddd�|jt|�d�y#1swY�%xYwrw)r<rr?�popitem�popr=rryr{s    r�test_popitemzOrderedDictTests.test_popitem�s����&�&��L�����
��
������R�Z�Z�\�5�9�9�;�7��
�
�
�x�
(��J�J�L�)�����R��!�$�)�
(�s�,B!�!B*c�(�|j}td�D�cgc]}||f��}}||�}td�D]}|jd��|jd�|jd��|jt	|�d�ycc}w)N�rMT��lastr�)r<�ranger�r?ry)r.r<�irE�objs     r�test_popitem_lastz"OrderedDictTests.test_popitem_last�s����&�&��!&�r��+��A�!�Q����+��%� ���q��A��K�K�������D������������S��2�&��,s�Bc�t�|j}gd�}t|�||�}t|�|r7|j�\}}|j|j|�|�|r�7|j	t
�5|jd�ddd�|jt
|�d�|j|jd�d�Gd�d|�}|d��}|j|jd	d
�d
�|j|jdd�d�|j|jdd�d�|j|jdd�
�d�|j	t
�5|jd�ddd�y#1swY��xYw#1swYyxYw)Nrx�xyzri90c��eZdZd�Zy)�*OrderedDictTests.test_pop.<locals>.Missingc��y�Nrr1�r.r�s  r�__missing__z6OrderedDictTests.test_pop.<locals>.Missing.__missing__���rJN�r]r^r_r�r1rJr�Missingr����
rJr�r�rrr(rr7��default)r<rr�r?r=rry)r.r<rErQ�k�vr��ms        r�test_popzOrderedDictTests.test_pop�s]���&�&��L�����
��
�������9�9�;�D�A�q����R�V�V�A�Y��*���
�
�x�
(��F�F�5�M�)�����R��!�$��������5�)�5�1�	�k�	�
�a�L��������s�A���*�������s�A���*�������s�A���*�������s�A��.��2�
�
�
�x�
(�
�E�E�#�J�)�
(�)�
(��)�
(�s�=F!�F.�!F+�.F7c�j�|j}gd�}t|�||�}||�}|j||�|dd|ddz}||�}|j||�|j|t	|��|jt	|�|�|j|||dd��y)Nrxr���)r<rr?�assertNotEqualrA)r.r<rE�od1�od2s     r�
test_equalityzOrderedDictTests.test_equalitys����&�&��L������%� ���%� ������c�"��a�b�	�E�"�1�I�%���%� �����C��%�����d�3�i�(�����c��C�(����C��U�3�B�Z�!8�9rJc	������j}gd�}||��dg�_dg�_��fd�}|�j��tj��}||��j	|j�j��j	|j�j��jt
|d��tj��}||��j|j�j��j|j�j��j|j�j��j|j�j��jt
|d��td�j�5ttjdz�D]�}�j|��5tj tj"�|��}||��j|j�j��j|j�j��jt
|d��ddd���	ddd�|t%t'����|�}|j)��||�||���y#1swY��xYw#1swY�_xYw)	Nrx�x�zc�p��d|�d���}�j|�|��j|���jt|j��t�j����jt	|�t	����jt|�t���y)Nz
copy: z
od: )�assertIsNotr?rCrBry�type)�dup�msgrQr.s  ��r�checkz,OrderedDictTests.test_copying.<locals>.check1s����*-�r�2�C����S�"�c�*����S�"�%����T�#�)�)�+�.��R�X�X�Z�0@�A����S��X�s�2�w�/����T�#�Y��R��1rJ�yr	r)�proto)r<r�r��copy�assertIs�assertFalse�hasattr�deepcopyr?r�r�moduler��pickle�HIGHEST_PROTOCOL�subTest�loads�dumps�eval�reprrP)r.r<rEr�r�r��update_testrQs`      @r�test_copyingzOrderedDictTests.test_copying)s����&�&��M��
��
���u����u���	2�	�b�g�g�i���i�i��m��
�c�
��
�
�c�e�e�R�T�T�"��
�
�c�e�e�R�T�T�"������c�*�+��m�m�B���
�c�
����������%����������%����������%����������%������c�*�+�
�]�D�K�K�
8��v�6�6��:�;���\�\��\�.� �,�,�v�|�|�B��'>�?�C��#�J��$�$�S�U�U�B�D�D�1��$�$�S�U�U�B�D�D�1��$�$�W�S�#�%6�7�/�.�<�9�	�d�4��8�n��!�m�����2��
�k��
�k�"�o��/�.��9�
8�s%�12K%�#BK�<
K%�K"�K%�%K.c��|j}gd�}||�}|jtd�|j�dD���y)Nrxc3�@K�|]}t|�tk(���y�wr)r�rC)�.0�pairs  r�	<genexpr>z5OrderedDictTests.test_yaml_linkage.<locals>.<genexpr>\s����L�9K��D��J��,�9K�s�r)r<rs�all�
__reduce__r{s    r�test_yaml_linkagez"OrderedDictTests.test_yaml_linkageTsC���&�&��M��
��
��	
����L������9K�L�L�MrJc�N�|j}gd�}||�}|j|jt�|j	|j�d�d|_|j|jdd�|j|j�dddi�y)Nrxrr�r�)r<rr�__dict__rA�assertIsNoner�r�r?r{s    r�test_reduce_not_too_fatz(OrderedDictTests.test_reduce_not_too_fat^s����&�&��L��
��
�����b�k�k�4�0����"�-�-�/�!�,�-����������S�)�2�.���������+�c�2�Y�7rJc���|j}|�}||d<td|j�5tdtj
dz�D]|}t	jt	j||��}|j||�|jt|j��dg�|j|d|��~	ddd�y#1swYyxYw)Nrr	r�)
r<rr�r�r�r�r�r�r�r?rCrWr�)r.r<rQr�r�s     r�test_pickle_recursivez&OrderedDictTests.test_pickle_recursiveis����&�&��
�]����1���]�D�K�K�
8��r�6�#:�#:�Q�#>�?���l�l�6�<�<��E�#:�;��� � ��b�)�� � ��c�h�h�j�!1�A�3�7��
�
�c�!�f�c�*�	@�9�
8�
8�s�BC�Cc���|j}|gd��}|jt|�d�|jtt|��|�|jt|��d�y)Nrxz=OrderedDict({'c': 1, 'b': 2, 'a': 3, 'd': 4, 'e': 5, 'f': 6})z
OrderedDict())r<r?r�r�r�s   r�	test_reprzOrderedDictTests.test_reprvs_���&�&��
�U�
V������b��K�	M�����d�2�h���,�����k�m�,�o�>rJc�~�|j}|jd�}||d<|jt|�d�y)Nrlr�z8OrderedDict({'a': None, 'b': None, 'c': None, 'x': ...}))r<ror?r�r�s   r�test_repr_recursivez$OrderedDictTests.test_repr_recursive~s>���&�&��
�
!�
!�%�
(����3������b��F�	HrJc��|j}|�}|j�|d<t|�}|j|t�|j�|d<t|�}|j|t�y)Nr,)r<r�r�rr�strrB)r.r<rQ�rs    r�test_repr_recursive_valuesz+OrderedDictTests.test_repr_recursive_values�sf���&�&��
�]�������2����H��	
���a��%������2����H�����a��%rJc�X�|j}gd�}t|�||�}t|j��}|j	|jdd�d�|j	t|j��|�|j	|jdd�d�|j	t|j��dd�|j	|jdd	�
�d	�Gd�d|�}|j	|�jd
d	�d	�y)Nrxrr�r"r�r�)r�r�r:r*r�c��eZdZd�Zy)�1OrderedDictTests.test_setdefault.<locals>.Missingc��yr�r1r�s  rr�z=OrderedDictTests.test_setdefault.<locals>.Missing.__missing__�r�rJNr�r1rJrr�r��r�rJr�r()r<rrCrBr?�
setdefault)r.r<rErQ�
pair_orderr�s      r�test_setdefaultz OrderedDictTests.test_setdefault�s����&�&��L�����
��
���"�(�(�*�%�
�������s�B�/��3�����b�h�h�j�)�:�6�������s�B�/��4�����b�h�h�j�)�"�-�y�9�������s�A��6��:�	�k�	�	
�����-�-�a��3�Q�7rJc��|j}|�}d|d<d|d<|d=|jt|j��dg�d|d<|jt|j��ddg�y)Nrrrrrrr�r�s   r�
test_reinsertzOrderedDictTests.test_reinsert�su���&�&���]����3����3���s�G�����b�h�h�j�)�H�:�6���3������b�h�h�j�)�H�h�+?�@rJc��|j}|jd�}|jt|�td��|j	d�|jt|�td��|j	dd�|jt|�td��|j	dd�|jt|�td��|j	d�|jt|�td��|j	dd��|jt|�td	��|jt�5|j	d
�ddd�|jt�5|j	d
d�ddd�y#1swY�:xYw#1swYyxYw)N�abcder!�abdecF�cabder'rr��bcader�)r<ror?rC�move_to_endr=rr�s   r�test_move_to_endz!OrderedDictTests.test_move_to_end�sD���&�&��
�
!�
!�'�
*������b��4��=�1�
���s������b��4��=�1�
���s�E�"�����b��4��=�1�
���s�E�"�����b��4��=�1�
���s������b��4��=�1�
���s���'�����b��4��=�1�
�
�
�x�
(��N�N�3��)�
�
�
�x�
(��N�N�3��&�)�
(�)�
(��
(�
(�s�$F/�F;�/F8�;Gc��|j}|jd�}|jdd��|jt	|�t	d��|jdd��|jt	|�t	d��|jd�}|jd�|jt	|�t	d��|jd�|jt	|�t	d	��y)
Nrlr!Fr��cabr�acb�bca�bac)r<ror�r?rCr�s   r�test_move_to_end_issue25406z,OrderedDictTests.test_move_to_end_issue25406�s����&�&��
�
!�
!�%�
(��
���s���'�����b��4��;�/�
���s���'�����b��4��;�/�
�
!�
!�%�
(��
���s������b��4��;�/�
���s������b��4��;�/rJc��|j}td��}|di|��}|jtj|�tj|��y)Nrr�r1)r<rA�
assertGreaterr�	getsizeof)r.r<r$rQs    r�test_sizeofzOrderedDictTests.test_sizeof�sE���&�&���1�I��
�
�1�
�����3�=�=��,�c�m�m�A�.>�?rJc�:�|j}dj�}|j|�}|j|j	�t|�j	��|j|j
�t|�j
��y)Nz@the quick brown fox jumped over a lazy dog yesterday before dawn)r<�splitror?rWrArB)r.r<�srQs    r�
test_viewszOrderedDictTests.test_views�sl���&�&��N�T�T�V��
�
!�
!�!�
$���������D��H�M�M�O�4��������T�"�X�^�^�%5�6rJc��|j}Gd�d|�}gd�}|jt||�j��|�y)Nc��eZdZd�Zy)�3OrderedDictTests.test_override_update.<locals>.MyODc��t��r)r�)r.rf�kwdss   rrPz:OrderedDictTests.test_override_update.<locals>.MyOD.update�s
���k�!rJN)r]r^r_rPr1rJr�MyODr�s��
"rJr)rr rr�)r.r<rrBs    r�test_override_updatez%OrderedDictTests.test_override_update�sB���&�&��	"�;�	"�/������d�5�k�/�/�1�2�E�:rJc��|j}d}td�D]
}|d|fg�}�~tj�y)Ni�)r<r�r�
gc_collect)r.r<r��_s    r�test_highly_nestedz#OrderedDictTests.test_highly_nested�sA���&�&�����t��A���c�{�m�,�C������rJc
���|j}g�G�fd�d|�}d}td�D]}|d|fg�}||_�~tj�|j�t
ttd����y)Nc���eZdZ�fd�Zy)�:OrderedDictTests.test_highly_nested_subclass.<locals>.MyODc�<���j|j�yr)rYr�)r.�deleteds �r�__del__zBOrderedDictTests.test_highly_nested_subclass.<locals>.MyOD.__del__�s������t�v�v�&rJN)r]r^r_r)rs�rrr�s���
'rJr�d)r<r�r�rrr?rCr�)r.r<rr�r�rs     @r�test_highly_nested_subclassz,OrderedDictTests.test_highly_nested_subclass�s|����&�&����	'�;�	'����s��A���s��}�%�C��C�E��
���������$�x��c�
�';�"<�=rJc��|j}Gd�d�}d�}d}||�}||�}|||��}|�}d||<d||<d||<d|d<||=||=|jt|j��|dfdg�y)Nc�$�eZdZd�Zd�Zd�Zd�Zy)�9OrderedDictTests.test_delitem_hash_collision.<locals>.Keyc�D�||_tt|��|_yr)�_hashr��idrn)r.�hashs  rrDzBOrderedDictTests.test_delitem_hash_collision.<locals>.Key.__init__
s��!��
� ��D��]��
rJc��|jSr)r%r-s r�__hash__zBOrderedDictTests.test_delitem_hash_collision.<locals>.Key.__hash__����z�z�!rJc�T�	|j|jk(S#t$rYywxYw)NF)rn�AttributeError�r.r0s  r�__eq__z@OrderedDictTests.test_delitem_hash_collision.<locals>.Key.__eq__s,��!��:�:����4�4��%�!� �!�s��	'�'c��|jSrrmr-s r�__repr__zBOrderedDictTests.test_delitem_hash_collision.<locals>.Key.__repr__r*rJN)r]r^r_rDr)r.r0r1rJr�Keyr#s��
+�
"�
!�

"rJr1c�2�d}||dz
z}|dz|z|zdzS)NrMrrr1)r'�MINSIZEr�s   r�
blocking_hashzCOrderedDictTests.test_delitem_hash_collision.<locals>.blocking_hashs-���G����	�!�A���F�a�<�$�&��*�*rJr.�after)r5.r�)	r.r<r1r4�	COLLIDINGr��	colliding�blockingrQs	         r�test_delitem_hash_collisionz,OrderedDictTests.test_delitem_hash_collision	s����&�&��	"�	"�	+��	��)�n���	�N�	��}�Y�/�0��
�]����3����8����9�
���7���x�L��y�M�����b�h�h�j�)�S�#�J��+G�HrJc�`�|j}Gd�d�}|�}td�D]}|�}|||<�|jt�5t	|j��ddd�|jt�5t	|j
��ddd�|jt�5t|�ddd�|jt�5|j�ddd�y#1swY��xYw#1swY�mxYw#1swY�PxYw#1swYyxYw)Nc��eZdZd�Zy)�-OrderedDictTests.test_issue24347.<locals>.Keyc��td�S)Ni��)rr-s rr)z6OrderedDictTests.test_issue24347.<locals>.Key.__hash__4s
�� ��(�(rJN�r]r^r_r)r1rJrr1r<3s��
)rJr1r)	r<r�r=rrCr�rBr�r�)r.r<r1rQr�r�s      r�test_issue24347z OrderedDictTests.test_issue243470s����&�&��	)�	)��]���s��A��%�C��B�s�G��
�
�
�x�
(�������)�
�
�
�x�
(�������)�
�
�
�x�
(���H�)�
�
�
�x�
(��G�G�I�)�
(�
)�
(��
(�
(��
(�
(��
(�
(�s0�D�D�=D�&D$�D	�D�D!�$D-c�r�|j}Gd�d�}|�}d||�<|j�y)Nc��eZdZd�Zy)�-OrderedDictTests.test_issue24348.<locals>.Keyc��y)Nrr1r-s rr)z6OrderedDictTests.test_issue24348.<locals>.Key.__hash__Jr�rJNr>r1rJrr1rBIr�rJr1r)r<r�)r.r<r1rQs    r�test_issue24348z OrderedDictTests.test_issue24348Fs4���&�&��	�	��]����3�5�	�
�
�
�rJc��|j}|�}dD]3}dD],}t|�dk(r|jd��||z}|||<�.�5y)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)r<ryr�)r.r<rQ�c0�c1r�s      r�test_issue24667z OrderedDictTests.test_issue24667RsU���&�&��
�]��$�B�(���r�7�a�<��J�J�E�J�*��2�g����3��)�%rJc��|j}|�}tj|dd�|jdt	|��y�N�spamr�NULL)r<rA�__setitem__r~r�r�s   r�test_dict_setitemz"OrderedDictTests.test_dict_setitemks:���&�&��
�]������V�Q�'������b��*rJc���|j}|�}d|d<d|d<tj|d�|jt�5t|�ddd�y#1swYyxYw�NrrLr�ham)r<rA�__delitem__r=rr�r�s   r�test_dict_delitemz"OrderedDictTests.test_dict_delitemqsW���&�&��
�]����6�
���5�	�����V�$�
�
�
�x�
(���H�)�
(�
(���	A�A'c��|j}|�}d|d<d|d<tj|�|jdt	|��y)NrrLrrRrM)r<rArzr~r�r�s   r�test_dict_clearz OrderedDictTests.test_dict_clearzsE���&�&��
�]����6�
���5�	��
�
�2�������b��*rJc���|j}|�}d|d<d|d<tj|d�|jt�5t|�ddd�y#1swYyxYwrQ)r<rAr�r=rr�r�s   r�
test_dict_popzOrderedDictTests.test_dict_pop�sU���&�&��
�]����6�
���5�	�����V��
�
�
�x�
(���H�)�
(�
(�rUc���|j}|�}d|d<d|d<tj|�|jt�5t|�ddd�y#1swYyxYwrQ)r<rAr�r=rr�r�s   r�test_dict_popitemz"OrderedDictTests.test_dict_popitem�sS���&�&��
�]����6�
���5�	����R��
�
�
�x�
(���H�)�
(�
(�s�A�A&c��|j}|�}tj|dd�|jdt	|��yrK)r<rAr�r~r�r�s   r�test_dict_setdefaultz%OrderedDictTests.test_dict_setdefault�s8���&�&��
�]������F�A�&������b��*rJc��|j}|�}tj|dg�|jdt	|��y)N)rLrrM)r<rArPr~r�r�s   r�test_dict_updatez!OrderedDictTests.test_dict_update�s8���&�&��
�]�����B��
�&������b��*rJc����|j�G�fd�d�}d|j|<tj|�}~t	j
�|j
|��y)Nc���eZdZW��Zy)�/OrderedDictTests.test_reference_loop.<locals>.AN)r]r^r_rQris�r�Arb�s
�����BrJrc)r<rQ�weakref�ref�gc�collectr�)r.rcr�r<s   @r�test_reference_loopz$OrderedDictTests.test_reference_loop�sN����&�&��	�	�����Q���K�K��N��
�
�
�
�����!�#�rJc��tj|t|j�tj|d�|j�tj|d�|j�tj|d�|j�y)Nc�4�t|j��Sr)r�rW�r$s r�<lambda>z<OrderedDictTests.test_free_after_iterating.<locals>.<lambda>�s��4�����>rJc�4�t|j��Sr)r�r�rks rrlz<OrderedDictTests.test_free_after_iterating.<locals>.<lambda>�s��4����
�;KrJc�4�t|j��Sr)r�rBrks rrlz<OrderedDictTests.test_free_after_iterating.<locals>.<lambda>�s��4����	�?rJ)r�check_free_after_iteratingr�r<r-s r�test_free_after_iteratingz*OrderedDictTests.test_free_after_iterating�se���*�*�4��t�7G�7G�H��*�*�4�1I�4�K[�K[�\��*�*�4�1K�T�M]�M]�^��*�*�4�1J�D�L\�L\�]rJc�j�|j}|dddd��}|dddd��}|j�}|j�}||z}|t|j��z}|ddddd��}|j	|t|�z|�|j	||z|�|j	||�|j	||�|j�}||z}|ddddd��}|j	t|�|z|�|j	||z|�|j	||�|j
t||z�|�|j
tt|�|z�|�|j
t|t|�z�|�|j�}|d	z}|d
z}|j	||�|jt�5|dzddd�|jt�5|d	zddd�|jt�5|dzddd�|jt�5|d
zddd�|jt�5|dz}ddd�y#1swY��xYw#1swY�xYw#1swY�hxYw#1swY�QxYw#1swYyxYw)Nrr)rrrrr")rrr")rrrr")rrr"rr1��BAD)r<r�rCrBr?rAr�r�r=r>�
ValueError)r.r<rrr!r$�expecteds       r�test_merge_operatorz$OrderedDictTests.test_merge_operator�sI���&�&���A�!��*�+���A�!��*�+��
�F�F�H��
�F�F�H��	�Q���	�T�!�'�'�)�_����1��q�Q�7�8������T�!�W��h�/�����Q���)�����H�%�����H�%�
�F�F�H��	�Q����1��q�Q�7�8������a��1��h�/�����Q���)�����H�%��
�
�d�1�q�5�k�;�/��
�
�d�4��7�Q�;�'��5��
�
�d�1�t�A�w�;�'��5��6�6�8��	�R���	�R�������H�%�
�
�
�y�
)�
��H�*�
�
�
�y�
)�
��F�*�
�
�
�y�
)�
��I�*�
�
�
�y�
)�
��F�*�
�
�
�z�
*�
��J�A�+�
*�*�
)��
)�
)��
)�
)��
)�
)��
*�
*�s<�I9�J�$J�J�*J)�9J�J�J�J&�)J2c���t|jdgi�j��}tj�|jtjt|���yr)r�r<rBrfrgrs�
is_trackedr�)r.r�s  r�!test_ordered_dict_items_result_gcz2OrderedDictTests.test_ordered_dict_items_result_gc�sJ��
�$�"�"�D�"�:�.�4�4�6�
7��
�
�
��	
����
�
�d�2�h�/�0rJN)6r]r^r_rFrIrRrarjrprur|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr	r
rrr r9r?rDrIrOrTrWrYr[r]r_rhrprvr�cpython_onlyryr1rJrrr"s��T�01�,9�\*�	�D�A�
%�B�Y�L�"	�B�<�	%�	'��4:� )�VN�	8�+�?�H�&�8�(
A�'�&0�@�7�;�	�>�"%I�N�,
��2+��+���+�+�	�^�)�V
���	1��	1rJrc�&�eZdZdZdZd�Zd�Zd�Zy)�_TriggerSideEffectOnEqualrrc��|jj|jjk(r|j�|jxjdz
c_y)NrT)�	__class__�count�trigger�side_effectr-s  rr.z _TriggerSideEffectOnEqual.__eq__�sB���>�>���4�>�>�#9�#9�9�����������!��rJc��y)Nr�r1r-s rr)z"_TriggerSideEffectOnEqual.__hash__�s��rJc��t�r)�NotImplementedErrorr-s rr�z%_TriggerSideEffectOnEqual.side_effect�s��!�!rJN)r]r^r_rr�r.r)r�r1rJrr|r|�s��
�E��G���"rJr|c�.�eZdZeZej
Zd�Zy)�PurePythonOrderedDictTestsc�4���G��fd�dt�}|��|jtjd�df���|jtjd|�df��}t	j
d�}|j
t|tj�|�|j|jd�|j�tjd��|j|tjd|�df��y)Nc���eZdZ��fd�Zy)�HPurePythonOrderedDictTests.test_issue119004_attribute_error.<locals>.Keyc�����=yrr1�r.�TODEL�dict1s ��rr�zTPurePythonOrderedDictTests.test_issue119004_attribute_error.<locals>.Key.side_effect�
����%�LrJN�r]r^r_r��r�r�s��rr1r�����
!rJr1r�������@z('NoneType' object has no attribute 'key'r�rr�)
r|r<rAro�re�escape�assertRaisesRegexr,�operator�eqr?r�assertDictEqual)r.r1�dict2r�r�r�s    @@r� test_issue119004_attribute_errorz;PurePythonOrderedDictTests.test_issue119004_attribute_error�s����	!�+�	!����� � �����5�#��!?�@��� � �����3�5�#��!?�@���i�i�B�C�����~�s�H�K�K���N�������A�&����U�D�M�M�(�$;�<����U�D�M�M�1�c�e�S�/�$B�CrJN)r]r^r_�py_collr�r<r�r1rJrr�r��s��
�F��%�%�K�
DrJr�c��eZdZdZeZeZy)�CPythonBuiltinDictTestszaBuiltin dict preserves insertion order.

    Reuse some of tests in OrderedDict selectively.
    N)r]r^r_�__doc__�builtinsr�rAr<r1rJrr�r�s���
�F��KrJr�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 c�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�CPythonOrderedDictSideEffectsc�|�tjd�}|jt|tj
||�y)Nz$OrderedDict mutated during iteration)r�r�r��RuntimeErrorr�r�)r.r�r�r�s    r�check_runtime_error_issue119004z=CPythonOrderedDictSideEffects.check_runtime_error_issue119004$s+���i�i�>�?�����|�S�(�+�+�u�e�LrJc���G�fd�dt�}|jtjd|�df���|jtjd|�df��}|j	�|�|j|jd�|j�i�|j|tjd|�df��y)Nc���eZdZ�fd�Zy)�PCPythonOrderedDictSideEffects.test_issue119004_change_size_by_clear.<locals>.Keyc�&���j�yr�rz�r.r�s �rr�z\CPythonOrderedDictSideEffects.test_issue119004_change_size_by_clear.<locals>.Key.side_effect*s������
rJNr��r�s�rr1r�)s���
rJr1rr�r�r|r<rAror�r?rr��r.r1r�r�s   @r�%test_issue119004_change_size_by_clearzCCPythonOrderedDictSideEffects.test_issue119004_change_size_by_clear(s����	�+�	�� � �����3�5�#��!?�@��� � �����3�5�#��!?�@���,�,�U�E�:�������A�&����U�B�'����U�D�M�M�1�c�e�S�/�$B�CrJc�����G��fd�dt�}|��|jtjd�df���|jtjd|�df��}|j	�|�|j|jd�|j�tjd��|j|tjd|�df��y)Nc���eZdZ��fd�Zy)�UCPythonOrderedDictSideEffects.test_issue119004_change_size_by_delete_key.<locals>.Keyc�����=yrr1r�s ��rr�zaCPythonOrderedDictSideEffects.test_issue119004_change_size_by_delete_key.<locals>.Key.side_effect6r�rJNr�r�s��rr1r�5r�rJr1rr�rr�r��r.r1r�r�r�s   @@r�*test_issue119004_change_size_by_delete_keyzHCPythonOrderedDictSideEffects.test_issue119004_change_size_by_delete_key4s����	!�+�	!����� � �����5�#��!?�@��� � �����3�5�#��!?�@���,�,�U�E�:�������A�&����U�D�M�M�(�$;�<����U�D�M�M�1�c�e�S�/�$B�CrJc����G�fd�dt�}|jtjd|�df���|jtjd|�df��}|j	�|�|j|jd�|j�tjdd��|j|tjd|�df��y)Nc���eZdZ�fd�Zy)�WCPythonOrderedDictSideEffects.test_issue119004_change_linked_list_by_clear.<locals>.Keyc�:���j�dx�d<�d<y)Nr!rrr�r�s �rr�zcCPythonOrderedDictSideEffects.test_issue119004_change_linked_list_by_clear.<locals>.Key.side_effectCs������
�*-�-��c�
�U�3�ZrJNr�r�s�rr1r�Bs���
.rJr1rr�r)rrr!r�r�s   @r�,test_issue119004_change_linked_list_by_clearzJCPythonOrderedDictSideEffects.test_issue119004_change_linked_list_by_clearAs����	.�+�	.�
� � �����3�5�#��!?�@��� � �����3�5�#��!?�@���,�,�U�E�:�������A�&����U�D�M�M�*�c�$B�C����U�D�M�M�1�c�e�S�/�$B�CrJc�����G��fd�dt�}|��|jtjd�df���|jtjd|�df��}|j	�|�|j|jd�|j�dddd��|j|tjd|�df��y)Nc���eZdZ��fd�Zy)�\CPythonOrderedDictSideEffects.test_issue119004_change_linked_list_by_delete_key.<locals>.Keyc�����=d�d<y)Nr!rr1r�s ��rr�zhCPythonOrderedDictSideEffects.test_issue119004_change_linked_list_by_delete_key.<locals>.Key.side_effectPs����%�L� ��c�
rJNr�r�s��rr1r�Os���
!rJr1rr�rr!)rrr�r�r�s   @@r�1test_issue119004_change_linked_list_by_delete_keyzOCPythonOrderedDictSideEffects.test_issue119004_change_linked_list_by_delete_keyNs����	!�+�	!�
���� � �����5�#��!?�@��� � �����3�5�#��!?�@���,�,�U�E�:�������A�&����U��3�T�$B�C����U�D�M�M�1�c�e�S�/�$B�CrJc����G��fd�dt�}|��|jtjd�df���|jtjd|�df��}|j	|j
d�|j
�|�|j	|j
d�|j�tjd��|j|tjd|�df��y)Nc���eZdZdZ��fd�Zy)�`CPythonOrderedDictSideEffects.test_issue119004_change_size_by_delete_key_in_dict_eq.<locals>.Keyrc�����=yrr1r�s ��rr�zlCPythonOrderedDictSideEffects.test_issue119004_change_size_by_delete_key_in_dict_eq.<locals>.Key.side_effect_r�rJN)r]r^r_r�r�r�s��rr1r�]s
����G�
!rJr1rr�rr�)r|r<rAror?rr�r�r�s   @@r�5test_issue119004_change_size_by_delete_key_in_dict_eqzSCPythonOrderedDictSideEffects.test_issue119004_change_size_by_delete_key_in_dict_eq\s����	!�+�	!�
���� � �����5�#��!?�@��� � �����3�5�#��!?�@��������A�&����E�5�)�������A�&����U�D�M�M�(�$;�<����U�D�M�M�1�c�e�S�/�$B�CrJN)	r]r^r_r�r�r�r�r�r�r1rJrr�r�"s&��M�
D�D�D�D�DrJr�z0requires the C version of the collections modulec��eZdZeZej
ZejZejd��Z	d�Z
d�Zejd��Zy)�CPythonOrderedDictTestsc���|j}tj}tj}|j
}|d�}|d�}|d�}|d�}|d�}	|�}
||
|�d|
_||
|�|
jtd�D�cgc]}||f��c}�||
||zd|zzdzd	|zzd|	zz�|
jtdd
�D�cgc]}||f��c}�||
||zd|zzdzd
|zzd
|	zz�||
j�|d��||
j�|d��||
j�|d��|d�}|t|
�|�|t|
j��|�|t|
j��|�|t|
j��|�ycc}wcc}w)
N�nQ2P3PnPn2P�n2BI2n�n2P�P�Pn2Prr"rMr(r���iP2n2P)
r<�struct�calcsizer�calcobjsize�check_sizeofr�rPr�rWrBr�r�)
r.r<r��sizer��	basicsize�keysize�	entrysize�p�nodesizerQr��itersizes
             r�test_sizeof_exactz)CPythonOrderedDictTests.test_sizeof_exactvs����&�&���?�?���"�"���!�!���+�,�	��8�$���U�O�	��S�M���F�#��
�]��
�b�)�����
�b�)��
�	�	�5��8�,�8�a�A�q�6�8�,�-�
�b�)�g�%��!��+�a�/�!�I�+�=��(�
�J�K�
�	�	�5��B�<�0�<�a�A�q�6�<�0�1�
�b�)�g�%��1��,�r�1�B�y�L�@�2�h�;�N�O�
�b�g�g�i��c��#�
�b�h�h�j�$�s�)�$�
�b�i�i�k�4��9�%���>��
�d�2�h��!�
�d�2�7�7�9�o�x�(�
�d�2�8�8�:���)�
�d�2�9�9�;���*��-��0s�G*�%G/c�h�|j}|jd�}|jt|�td��|j	t
�5t
|�D](\}}|j|�|j|d��*	ddd�|j	t
�5|D]}d|d<�		ddd�|j	t
�5|D]}|d=�	ddd�|jt|�td��y#1swY��xYw#1swY�cxYw#1swY�FxYw)Nr�r(r6r!�bdeaf)	r<ror?rCr=r��	enumerater��
assertLess)r.r<rQr�r�s     r� test_key_change_during_iterationz8CPythonOrderedDictTests.test_key_change_during_iteration�s����&�&��
�
!�
!�'�
*������b��4��=�1�
�
�
�|�
,�!�"�
���1����q�!�����1�%�&�-��
�
�|�
,�����3���-��
�
�|�
,����s�G��-�	
����b��4��=�1�-�
,��-�
,��-�
,�s$�7D�,
D�D(�D�D%�(D1c�
�|j}gd�}||�}dD]�}t||�}t|��dd}ttj
dz�D]�}|j
||��5t|��}t|�t	j||�}	t	j|	�}
|jt|
�|�|jt|�|�ddd�����y#1swY��xYw)Nrx)rWr�rBr)�method_name�protocol)r<�getattrrCr�r�r�r�r�r�r�r�r?)r.r<rErQr��methrur�r�r��	unpickleds           r�test_iterators_picklingz/CPythonOrderedDictTests.test_iterators_pickling�s����&�&��L��
��
��6�K��2�{�+�D��D�F�|�A�B�'�H��6�2�2�Q�6�7���\�\�k�A�\�F��d�f��B���H����R��+�A� &���Q��I��$�$�T�)�_�h�?��$�$�T�"�X�x�8�
G�F�8�7�G�F�s
�/A=C9�9Dc��tj�|j�}||_g}|j	|�tj|�}|j	|�~~~tj�yr)rfrgr<�cyclerYrdre)r.r�r��x_refs    r�"test_weakref_list_is_not_traversedz:CPythonOrderedDictTests.test_weakref_list_is_not_traversed�s\��
	�
�
������������
���U�����A���
���U��
�u�e�
�
�
�rJN)
r]r^r_�c_collr�r<rr�rzr�r�r�r�r1rJrr�r�ms\��
�F��$�$�K��'�'�L����+��+�@2�"9�"
�����rJr�c�:�eZdZeZGd�dej
�Zy)�"PurePythonOrderedDictSubclassTestsc��eZdZy)�.PurePythonOrderedDictSubclassTests.OrderedDictN�r]r^r_r1rJrr<r�����rJr<N)r]r^r_r�r�r<r1rJrr�r��s��
�F�
�g�)�)�
rJr�c�:�eZdZeZGd�dej
�Zy)�CPythonOrderedDictSubclassTestsc��eZdZy)�+CPythonOrderedDictSubclassTests.OrderedDictNr�r1rJrr<r��r�rJr<N)r]r^r_r�r�r<r1rJrr�r��s��
�F�
�f�(�(�
rJr�c�R�eZdZeZGd�dej
�ZejZy)�*PurePythonOrderedDictWithSlotsCopyingTestsc��eZdZdZy)�6PurePythonOrderedDictWithSlotsCopyingTests.OrderedDict�r�r�N�r]r^r_�	__slots__r1rJrr<r������	rJr<N)r]r^r_r�r�r<rr�r1rJrr�r��s$��
�F��g�)�)��#�0�0�LrJr�c�R�eZdZeZGd�dej
�ZejZy)�'CPythonOrderedDictWithSlotsCopyingTestsc��eZdZdZy)�3CPythonOrderedDictWithSlotsCopyingTests.OrderedDictr�Nr�r1rJrr<r�r�rJr<N)r]r^r_r�r�r<rr�r1rJrr�r��s&���F��f�(�(��#�0�0�LrJr�c�"�eZdZed��Zd�Zy)�PurePythonGeneralMappingTestsc�.�tj|_yr�r�r<�	type2test��clss r�
setUpClassz(PurePythonGeneralMappingTests.setUpClass�s���+�+��
rJc�d�|j�}|jt|j�yr��_empty_mappingr=rr��r.r$s  rr�z*PurePythonGeneralMappingTests.test_popitem��$�����!�����(�A�I�I�.rJN�r]r^r_�classmethodr	r�r1rJrrr�s���,��,�/rJrc�"�eZdZed��Zd�Zy)�CPythonGeneralMappingTestsc�.�tj|_yr�r�r<rrs rr	z%CPythonGeneralMappingTests.setUpClass�s���*�*��
rJc�d�|j�}|jt|j�yrrr
s  rr�z'CPythonGeneralMappingTests.test_popitem�rrJNrr1rJrrr�s���+��+�/rJrc�"�eZdZed��Zd�Zy)�PurePythonSubclassMappingTestsc�D�Gd�dtj�}||_y)Nc��eZdZy)�@PurePythonSubclassMappingTests.setUpClass.<locals>.MyOrderedDictNr�r1rJr�
MyOrderedDictr���rJrr�rrs  rr	z)PurePythonSubclassMappingTests.setUpClasss��	�G�/�/�	�%��
rJc�d�|j�}|jt|j�yrrr
s  rr�z+PurePythonSubclassMappingTests.test_popitemrrJNrr1rJrrrs���&��&�
/rJrc�"�eZdZed��Zd�Zy)�CPythonSubclassMappingTestsc�D�Gd�dtj�}||_y)Nc��eZdZy)�=CPythonSubclassMappingTests.setUpClass.<locals>.MyOrderedDictNr�r1rJrrr#rrJrrrs  rr	z&CPythonSubclassMappingTests.setUpClasss��	�F�.�.�	�%��
rJc�d�|j�}|jt|j�yrrr
s  rr�z(CPythonSubclassMappingTests.test_popitemrrJNrr1rJrr r s���&��&�
/rJr c�<��eZdZ�fd�Z�fd�Z�fd�Z�fd�Z�xZS)�SimpleLRUCachec�f��t�|��||_tj	dd�|_y)N��get�set�delr)�superrDr�rAro�counts)r.r�r~s  �rrDzSimpleLRUCache.__init__!s(���
������	��m�m�$9�1�=��rJc�v��|jdxxdz
cc<t�|�	|�}|j|�|S)Nr)r)r-r,�__getitem__r�)r.�itemrnr~s   �rr/zSimpleLRUCache.__getitem__&s9������E��a�����#�D�)��������rJc���|jdxxdz
cc<||vrGt|�|jk\r/|jd��||vrt|�|jk\r�/t�|�||�|j
|�y)Nr*rFr�)r-ryr�r�r,rNr�)r.r�rnr~s   �rrNzSimpleLRUCache.__setitem__,sp������E��a�����o�#�d�)�t�y�y�"8��L�L�e�L�$���o�#�d�)�t�y�y�"8�
���C��'�����rJc�R��|jdxxdz
cc<t�|�	|�y)Nr+r)r-r,rS)r.r�r~s  �rrSzSimpleLRUCache.__delitem__3s$������E��a���
���C� rJ)r]r^r_rDr/rNrS�
__classcell__)r~s@rr&r&s���>�
��!�!rJr&c�$�eZdZd�Zd�Zd�Zd�Zy)�SimpleLRUCacheTestsc��|jd�}d|d<d|d<d|d<|j|jdddd��|jt|�ddg�|j|jdddd��y)	Nrr�t1�t2r"�t3rr()rr?r-rC)r.r!s  r�test_add_after_fullz'SimpleLRUCacheTests.test_add_after_full:sy���N�N�1�����$����$����$��������1�Q�q�#A�B�����a��4��,�/�������1�Q�q�#A�BrJc��|jd�}tdd�D]}|||<�	|j|jd��d�|j|jd��d�|j|jd	dd	d
��y)Nr"rr%Fr�)rrT)r"r"rr()rr�r?r�r-�r.r!r�s   rr�z SimpleLRUCacheTests.test_popitemCsz���N�N�1����q�!��A��A�a�D����������.��7���������-�v�6�������1�Q�q�#A�BrJc��|jd�}tdd�D]}|||<�	|j|jdddd��|j|j	d�d�|j|jdddd��|j|j	dd�d�|j|jdddd��|jt|jd�|j|jdddd��y)Nr"rr%rr(r)rr�r?r-r�r=rr<s   rr�zSimpleLRUCacheTests.test_popKs����N�N�1����q�!��A��A�a�D��������1�Q�q�#A�B�������q��1�%�������1�Q�q�#A�B�������q�!��a�(�������1�Q�q�#A�B����(�A�E�E�1�-�������1�Q�q�#A�BrJc	��|jd�}tdd�D]}|||<�	|jt|�ttdd���|j|jdddd��|j|dd�|j|jdddd��|jt|�gd��y)Nr"rr%rr(r)rr"r)rr�r?rCr-r<s   r�test_change_order_on_getz,SimpleLRUCacheTests.test_change_order_on_getWs����N�N�1����q�!��A��A�a�D������a��$�u�Q��{�"3�4�������1�Q�q�#A�B�����1��q�!�������1�Q�q�#A�B�����a��)�,rJN)r]r^r_r:r�r�r?r1rJrr5r58s��C�C�
C�-rJr5c�8�eZdZGd�deej
�Zy)�PySimpleLRUCacheTestsc��eZdZy)�PySimpleLRUCacheTests.type2testNr�r1rJrrrCdr�rJrN)r]r^r_r&r�r<rr1rJrrArAbs��
�N�G�$7�$7�
rJrAc��eZdZed��Zy)�CSimpleLRUCacheTestsc�N�Gd�dttj�}||_y)Nc��eZdZy)�2CSimpleLRUCacheTests.setUpClass.<locals>.type2testNr�r1rJrrrHmrrJr)r&r�r<r)rrs  rr	zCSimpleLRUCacheTests.setUpClassks��	���(:�(:�	�!��
rJN)r]r^r_rr	r1rJrrErEhs���"��"rJrE�__main__)5r��
contextlibr�rfr�r�r��randomrrr�r�unittestrd�collections.abcr�testrr�test.supportr�import_fresh_moduler�r��contextmanagerrrr|�TestCaser�r�r�method�setattrr�r��
skipUnlessr�r�r�r�r��BasicTestMappingProtocolrrrr r&r5rArEr]�mainr1rJr�<module>rXs������	��
�	�%�
�
���*�'�&�,�-�
+�
+�M�5C�4D�F��	*��	*�	*�=�2@�1A�
C�����,��,�D1�D1�N"�"�"D�!1�8�3D�3D�D�*�h�/�/��#�%*�E�G�,�F��#�V�W�5E�v�-N�O�
,��HD�HD�V����V�O�P�]�.�;�&�/�/�]�Q�]�@
�)C�
�
�&=�
�1��1B�1B�1�����V�O�P�1�h�.?�.?�1�Q�1�/�M�$J�$J�/�����V�O�P�/��!G�!G�/�Q�/�
/�]�%K�%K�
/�����V�O�P�
/�-�"H�"H�
/�Q�
/�!�!�2'-�'-�T
�/��1B�1B�
�����V�O�P�"�.��0A�0A�"�Q�"��z���H�M�M�O�rJ

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