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.7/test/__pycache__/test_index.cpython-37.pyc
B

��gw!�@s ddlZddlmZddlZejZGdd�d�ZGdd�de�ZGdd�dej	�Z
Gd	d
�d
�ZGdd�deej	�ZGd
d�d�Z
Gdd�deej	�ZGdd�deej	�ZGdd�deej	�ZGdd�deej	�ZGdd�deej	�ZGdd�dej	�ZGdd�dej	�Zedk�re��dS)�N)�supportc@seZdZdd�ZdS)�newstylecCs|jS)N)�ind)�self�r�+/usr/local/lib/python3.7/test/test_index.py�	__index__sznewstyle.__index__N)�__name__�
__module__�__qualname__rrrrrrsrc@seZdZdd�ZdS)�TrapIntcCst|�S)N)�int)rrrrrszTrapInt.__index__N)r	r
rrrrrrr
src@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BaseTestCasecCst�|_t�|_dS)N)r�o�n)rrrr�setUpszBaseTestCase.setUpcCs<d|j_d|j_|�t�|j�d�|�t�|j�d�dS)N����)rrr�assertEqual�operator�index)rrrr�
test_basicszBaseTestCase.test_basiccCs�d|j_d|j_t|j|j|j�}tddd�}|�|�|j�|�d��t|j|j|j�}tddd�}|�|�|j�|�d��dS)N�r)rrr�slicer�indices)rZslcZ	check_slcrrr�
test_sliceszBaseTestCase.test_slicecCszd|j_d|j_|�d��d�|�d��d�|�|j��d�|�|j��d�|�d��d�|�d��d	�dS)
N����i����TrFr)rrrrr)rrrr�
test_wrappers#szBaseTestCase.test_wrapperscCsLttd��}|�|td�td��|dd��|�tt���d�d�dS)N�
rr)rrr)�list�rangerrrr)r�rrrr�test_subclasses-s$zBaseTestCase.test_subclassescCsdd|j_d|j_|�ttj|j�|�ttj|j�|�tt|j�jd�|�tt|j�jd�dS)N�dumb�badr)	rrr�assertRaises�	TypeErrorrrrr)rrrr�
test_error2szBaseTestCase.test_errorcCsVGdd�dt�}|d�}|��}t�|�}|�|d�|�|d�|�t|�t�dS)Nc@seZdZdd�ZdS)z8BaseTestCase.test_int_subclass_with_index.<locals>.MyIntcSst|�dS)Nr)r
)rrrrr>szBBaseTestCase.test_int_subclass_with_index.<locals>.MyInt.__index__N)r	r
rrrrrr�MyInt=sr+r�)r
rrrr�assertIs�type)rr+Zmy_intZdirect_indexZoperator_indexrrr�test_int_subclass_with_index:s
z)BaseTestCase.test_int_subclass_with_indexc	CspGdd�d�}Gdd�dt�}|�}|�t��t�|�}WdQRX|�|d�|�}t�|�}|�|d�dS)Nc@seZdZdd�ZdS)z<BaseTestCase.test_index_returns_int_subclass.<locals>.BadIntcSsdS)NTr)rrrrrLszFBaseTestCase.test_index_returns_int_subclass.<locals>.BadInt.__index__N)r	r
rrrrrr�BadIntKsr0c@seZdZdd�ZdS)z=BaseTestCase.test_index_returns_int_subclass.<locals>.BadInt2cSsdS)NTr)rrrrrPszGBaseTestCase.test_index_returns_int_subclass.<locals>.BadInt2.__index__N)r	r
rrrrrr�BadInt2Osr1rr)r
ZassertWarns�DeprecationWarningrrr)rr0r1Zbad_intrrrr�test_index_returns_int_subclassJs
z,BaseTestCase.test_index_returns_int_subclassN)r	r
rrrrr r%r*r/r3rrrrrs

rc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�SeqTestCasecCs$t�|_t�|_t�|_t�|_dS)N)rrr�o2�n2)rrrrr`szSeqTestCase.setUpcCsHd|j_d|j_|�|j|j|jd�|�|j|j|jd�dS)Nrr)rrrr�seq)rrrr�
test_indexfszSeqTestCase.test_indexcCsld|j_d|j_d|j_d|j_|�|j|j|j�|jdd��|�|j|j|j�|jdd��dS)Nr�rr)rrr5rr6rr7)rrrrrls$zSeqTestCase.test_slicecCs:t|j�}t|d�|j_|d|j_|�|j|jd�|jdd��|�|jd|j�|j�|�|j|jd�|jdd��|�|jd|j�|j�|d|j_t|d�|j_|�|j|jd�|j�|�|jd|j�|jdd��|�|j|jd�|j�|�|jd|j�|jdd��dS)Ng�?rr)	�lenr7r
rrrrr5r6)rZseqlenrrr�test_slice_bug7532ts
"""zSeqTestCase.test_slice_bug7532cCs|d|j_d|j_|�|j|j|jd�|�|j|j|jd�|�|j|j|jd�|�|j|j|jd�dS)Nr9r)rrrrr7)rrrr�test_repeat�szSeqTestCase.test_repeatcCs�d|j_d|j_|�|j�|j�|jd�|�|j�|j�|jd�|�|j�|j�|jd�|�|j�|j�|jd�|�|j�|j�|jd�|�|j�|j�|jd�dS)Nrr)rrrrr7�__getitem__�__mul__�__rmul__)rrrrr �szSeqTestCase.test_wrapperscCs|�|jt�|jd�dS)Nr)rr7r)rrrrr%�szSeqTestCase.test_subclassescCsld|j_d|j_dd�}|�t||j|�|�t||j|�dd�}|�t||j|�|�t||j|�dS)Nr&r'cSs
|j|S)N)r7)�x�objrrr�<lambda>��z(SeqTestCase.test_error.<locals>.<lambda>cSs|j|d�S)N)r7)r@rArrrrB�rC)rrrr(r))rZindexobjZsliceobjrrrr*�szSeqTestCase.test_errorN)r	r
rrr8rr;r<r r%r*rrrrr4]s
r4c@s,eZdZddddddgZdd�Zd	d
�ZdS)�ListTestCaserr!���(�2c
Cs�d|j_d|j_td�}||j=||j=d||j<d||j<|�|td��ddd	d
ddd
g}|�|jd�|�|dddd
ddd
g�|�|j�|�|ddd
ddd
g�dS)Nrrzab!cdefghi!j�X�YZ
abYdefghXjrrrr,�	r!��here)rrrr"r�__setitem__�__delitem__)r�lstrrr�test_setdelitem�s

zListTestCase.test_setdelitemc	Cs�d|j_d|j_ddg}||j9}|�|ddddg�||j9}|�|ddddgd�dddddd	g}|�|j�}|�||�|�|dddddd	gd�dS)
Nrr9rrrrr,rKrL)rrrr�__imul__r-)rrP�l2rrr�test_inplace_repeat�s

z ListTestCase.test_inplace_repeatN)r	r
rr7rQrTrrrrrD�srDc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZeZdd�Z	d
S)�NewSeqcCst|�|_dS)N)r"�_list)r�iterablerrr�__init__�szNewSeq.__init__cCs
t|j�S)N)�reprrV)rrrr�__repr__�szNewSeq.__repr__cCs
|j|kS)N)rV)r�otherrrr�__eq__�sz
NewSeq.__eq__cCs
t|j�S)N)r:rV)rrrr�__len__�szNewSeq.__len__cCs|�|j|�S)N)�	__class__rV)rrrrrr>�szNewSeq.__mul__cCs
|j|S)N)rV)rrrrrr=�szNewSeq.__getitem__N)
r	r
rrXrZr\r]r>r?r=rrrrrU�srUc@seZdZdZdS)�
TupleTestCase)rr!rErFrGrHN)r	r
rr7rrrrr_�sr_c@seZdZed�ZdS)�ByteArrayTestCasesthis is a testN)r	r
r�	bytearrayr7rrrrr`�sr`c@seZdZdZdS)�
BytesTestCasesthis is a testN)r	r
rr7rrrrrb�srbc@seZdZdZdS)�StringTestCasezthis is a testN)r	r
rr7rrrrrc�srcc@seZdZed�ZdS)�NewSeqTestCase)rr!rErFrGrHN)r	r
rrUr7rrrrrd�srdc@seZdZdd�ZdS)�
RangeTestCasecCs>t�}d|_|�tdd�|d�|�tdd��|�d�dS)NrrrEr)rrrr#r=)rrrrr�
test_range�szRangeTestCase.test_rangeN)r	r
rrfrrrrre�srec@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�OverflowTestCasecCsdd|_|j|_dS)Nr�d)�pos�neg)rrrrr�s
zOverflowTestCase.setUpcCs,|�|j��|j�|�|j��|j�dS)N)rrirrj)rrrr�test_large_longs�sz!OverflowTestCase.test_large_longscCs�Gdd�d�}|�}|�||j|j�|�||j|j�|�||j|j��t�dtdf�|�||j|jd��t�dtdf�dS)Nc@seZdZdd�Zdd�ZdS)z.OverflowTestCase.test_getitem.<locals>.GetItemcSsdstd��dS)NFz__len__ should not be invoked)�AssertionError)rrrrr]sz6OverflowTestCase.test_getitem.<locals>.GetItem.__len__cSs|S)Nr)r�keyrrrr=sz:OverflowTestCase.test_getitem.<locals>.GetItem.__getitem__N)r	r
rr]r=rrrr�GetItemsrnrr)rrirjr�maxsize)rrnr@rrr�test_getitem�szOverflowTestCase.test_getitemcs,��t�fdd����t�fdd��dS)Ncs
d�jS)N�a)rir)rrrrBrCz7OverflowTestCase.test_sequence_repeat.<locals>.<lambda>cs
d�jS)Nrq)rjr)rrrrBrC)r(�
OverflowError)rr)rr�test_sequence_repeat
sz%OverflowTestCase.test_sequence_repeatN)r	r
rrrkrprsrrrrrg�srg�__main__)ZunittestZtestrrZMAX_Py_ssize_trorr
rZTestCaserr4rDrUr_r`rbrcrdrergr	�mainrrrr�<module>s$OF"