HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_dictviews.cpython-310.pyc
o

�i�6�@sRddlZddlZddlZddlZddlZGdd�dej�Zedkr'e�	�dSdS)�Nc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�DictSetTestcCsvti���}|�t|i�|�t|�ti���}|�t|i�|�t|�ti���}|�t|i�|�t|�dS�N)�type�keys�assertRaises�	TypeError�items�values)�selfZkt�itZvt�r�0/usr/local/lib/python3.10/test/test_dictviews.py�test_constructors_not_callable	sz*DictSetTest.test_constructors_not_callablecCsddd�}|��}|�t|�d�|�t|�ddh�|�|ddh�|�|hd��|�|ddh�|�|dh�|�|d	�|�d|�|�d|�|�d|�|�d
|�|�|��|���ddd�}|�|��|���|d=|�|��|���dS)
N�
�ABC���a�rr>rr�br�*�Z��def)r�assertEqual�len�set�assertNotEqual�assertIn�assertNotIn)r
�dr�errr
�test_dict_keyss$

zDictSetTest.test_dict_keyscCs$ddd�}|��}|�t|�d�|�t|�ddh�|�|ddh�|�|hd��|�|ddh�|�|dh�|�|d	�|�d|�|�d|�|�d
|�|�d|�|�d|�|�d
|�|�d|�|�|��|���|��}|�|��|���d|d<|�|��|���dS)Nrrrr�rr�rr>r$Zjunkr#)rrr)rrrr)r)rr�rr)rrrrrrr�copy)r
r rr!rrr
�test_dict_items(s*
zDictSetTest.test_dict_itemscCs@ddd�}ddd�}|�|��|���|�|��|���dS)Nr�))rr)rrrr�rr)rrrr)r
r r!rrr
�test_dict_mixed_keys_items?s

z&DictSetTest.test_dict_mixed_keys_itemscCs:ddd�}|��}|�t|�ddh�|�t|�d�dS)Nrrrr)r	rrr)r
r r	rrr
�test_dict_valuesEs
zDictSetTest.test_dict_valuescCs�ddd�}|�t|�t�t|���}|�|t�|�|dkp"|dk�t|���}|�|t�|�|dkp9|dk�t|���}|�|t�|�|dkpP|d	k�dS)
Nrrrz#dict_items([('a', 'ABC'), (1, 10)])z#dict_items([(1, 10), ('a', 'ABC')])zdict_keys(['a', 1])zdict_keys([1, 'a'])zdict_values(['ABC', 10])zdict_values([10, 'ABC']))�assertIsInstance�repr�strr�
assertTruerr	�r
r �rrrr
�test_dict_reprKs"
���zDictSetTest.test_dict_reprcs�ddd�}ddd�}ddd�}d	di}G�fd
d�dt��|�|��|��@dd
h�|�|��|��@d
h�|�|��|��@t��|�|��t|���@dd
h�|�|��t|���@d
h�|�|��t|���@t��|�|��t|���@dd
h�|�|��|��@d	h�|�|��|��@d	h�|�|��t|���@d	h�|�|��t|���@t�|�t|���|��@t�|�t|���|���@�t�|�t|��g@�t�|�tg|��@�t�|�|��|��Bdd
h�|�|��|��Bhd��|�|��|��Bhd��|�|��t|���Bdd
h�|�|��t|���Bhd��|�|��t|���Bhd��|�|��dBhd��|�|��|��At��|�|��|��Addh�|�|��|��Ahd��|�|��t|���At��|�|��t|���Addh�|�|��t|���Ahd��|�|��t|���Addh�|�|��|��t��|�|��|��dh�|�|��|��dd
h�|�|��t|���t��|�|��t|���dh�|�|��t|���dd
h�|�|��ddd
h�|�|���	|����|�|���	|����|�|���	t
|�����|�|���	t|�����|�|���	hd���|�|���	gd���|�|���	tgd����|�|���	tddg���|�|���	ddg��|�|���	i��|�|���	|����i}|�|���	t���|�|���	g��|�|���	|����|�|���	dg��dS)Nrr�rrr%)r�c���r r!r cseZdZ��fdd�Z�ZS)z7DictSetTest.test_keys_set_operations.<locals>.CustomSetcs�t��|��Sr)�super�intersection�r
�other)�	CustomSet�	__class__rr
r9bszDDictSetTest.test_keys_set_operations.<locals>.CustomSet.intersection)�__name__�
__module__�__qualname__r9�
__classcell__r�r<)r=r
r<asr<rr>rrr4>rrr r!r)>rrrrr4)rr��x�z�y�rDrFrErDrF)rrr�tupler,�	frozensetZassertIsr�assertFalse�
isdisjoint�listr/)r
�d1�d2�d3Zd4�derrBr
�test_keys_set_operations[sz


     � �  z$DictSetTest.test_keys_set_operationscCs�ddd�}ddd�}ddd�}|�|��|��@ddh�|�|��|��@dh�|�|��|��@t��|�|��t|���@ddh�|�|��t|���@dh�|�|��t|���@t��|�|��|��Bddh�|�|��|��Bhd	��|�|��|��Bhd
��|�|��t|���Bddh�|�|��t|���Bhd	��|�|��t|���Bhd
��|�|��|��At��|�|��|��Addh�|�|��|��Ahd
��|�|��|��t��|�|��|��dh�|�|��|��ddh�|�|��t|���t��|�|��t|���dh�|�|��t|���ddh�|�|���|����|�|���|����|�|���t|�����|�|���t|�����|�|���hd���|�|���gd
���|�|���tgd
����|�|���tddg���|�|���i��|�|���|����i}|�|���t���|�|���g��|�|���|����|�|���dg��dS)Nrrr3r5r6r7�rr�rr>rSrR�rr>rS)r!r6)r r5rRrTrCrGrDrF)rrrrJrKrLr/)r
rMrNrOrPrrr
�test_items_set_operations�sv


���������� z%DictSetTest.test_items_set_operationscCs�ddd�}|�|��tddg�@dh�|�|��tddg�Bhd��|�|��tddg�Addh�|�|��tddg�dh�|��}|�|tdg�@dh�|�|tdg�Adh�|�|tdg�Bddh�|�|tdg�dh�dS)	Nrr5)rr%r>rrr%r%r))r%r5)rr�iterr)r
�originrrrr
�!test_set_operations_with_iterator�s
  z-DictSetTest.test_set_operations_with_iteratorcCs�|�t��i��d@Wd�n1swY|�t��i��dBWd�n1s1wY|�t��i��dAWd�n1sLwY|�t��i��dWd�n1sgwY|�t��i��d@Wd�n1s�wY|�t��i��dBWd�n1s�wY|�t��i��dAWd�n1s�wY|�t��i��dWd�dS1s�wYdS)Nr)rrrr�r
rrr
�$test_set_operations_with_noniterable�s0�������"�z0DictSetTest.test_set_operations_with_noniterablecCsHi}|��|d<t|�}|�|t�|��|d<t|�}|�|t�dS)Nr)r	r-r,r.rr0rrr
�test_recursive_repr�szDictSetTest.test_recursive_reprcCs8i}tt��d�D]}d|��i}q
|�tt|�dS)N�dr)�range�sys�getrecursionlimitr	r�RecursionErrorr-)r
r �irrr
�test_deeply_nested_reprsz#DictSetTest.test_deeply_nested_reprcCsJddd�}|�ttj|���|�ttj|���|�ttj|���dS)Nrrr)rrr&rr	r�r
r rrr
�	test_copys
zDictSetTest.test_copycsGdd�dt��G�fdd�d�}|�|�}}|�|�}}||i}|�||�|�||���|�||���|�||f|���|��|j|�|��|��j|�|��|��j||f�|��|��j||f�|����||��vWd�dS1s�wYdS)Nc@seZdZdS)z+DictSetTest.test_compare_error.<locals>.ExcN)r>r?r@rrrr
�Excsrecs eZdZdd�Z�fdd�ZdS)z-DictSetTest.test_compare_error.<locals>.BadEqcSsdS)N�rrYrrr
�__hash__�z6DictSetTest.test_compare_error.<locals>.BadEq.__hash__cs��rrr:�rerr
�__eq__rhz4DictSetTest.test_compare_error.<locals>.BadEq.__eq__N)r>r?r@rgrjrrirr
�BadEqsrk)�	Exceptionrrr	rr�__contains__)r
rkZk1Zk2Zv1Zv2r rrir
�test_compare_errors "�zDictSetTest.test_compare_errorcCsvddd�}ttjd�D],}|�ttjftj|��|�|�ttjftj|��|�|�ttjftj|�	�|�qdS)Nrrrr)
r]�pickle�HIGHEST_PROTOCOLrr�
PicklingError�dumpsrr	r)r
r �protorrr
�test_pickle,s
����zDictSetTest.test_picklecCsvtdd�}|�|��tjj�|�|��tjj�|�|��tjj�|�|��tjj�|�|��tjj	�|�|��tjj
�|�|��tjj�|�|��tjj�|�|��tjj�|�|��tjj
�|�|��tjj	�|�|��tjj
�|�|��tjj�|�|��tjj�|�|��tjj�|�|��tjj�|�|��tjj	�|�|��tjj
�dS)Nr)r)�dictr,r�collections�abc�KeysView�MappingView�Set�Sized�Iterable�	Containerr	�
ValuesView�
Collectionr�	ItemsViewrcrrr
�test_abc_registry6s&
zDictSetTest.test_abc_registryN)r>r?r@rr"r'r*r+r2rQrUrXrZr[rbrdrnrtr�rrrr
rs"F8


r�__main__)
�collections.abcrvr&ror^ZunittestZTestCaserr>�mainrrrr
�<module>sJ�