HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/test/__pycache__/test_index.cpython-36.pyc
3


 \w!�@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�rej�dS)�N)�supportc@seZdZdd�ZdS)�newstylecCs|jS)N)�ind)�self�r�"/usr/lib64/python3.6/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_|jtj|j�d�|jtj|j�d�dS)N����r)rrr�assertEqual�operator�index)rrrr�
test_basicszBaseTestCase.test_basiccCs�d|j_d|j_t|j|j|j�}tddd�}|j|j|j�|jd��t|j|j|j�}tddd�}|j|j|j�|jd��dS)N�r)rrr�slicer�indices)rZslcZ	check_slcrrr�
test_sliceszBaseTestCase.test_slicecCszd|j_d|j_|jdj�d�|jdj�d	�|j|jj�d�|j|jj�d�|jdj�d�|jdj�d�dS)
N����TrFri����)rrrrr)rrrr�
test_wrappers#szBaseTestCase.test_wrapperscCsLttd��}|j|td�td��|dd��|jtt��jd�d�dS)N�
rrr)rrr)�list�rangerrrr)r�rrrr�test_subclasses-s$zBaseTestCase.test_subclassescCsdd|j_d|j_|jttj|j�|jttj|j�|jtt|j�jd�|jtt|j�jd�dS)N�dumb�badr)	rrr�assertRaises�	TypeErrorrrrr)rrrr�
test_error2szBaseTestCase.test_errorcCsVGdd�dt�}|d�}|j�}tj|�}|j|d�|j|d�|jt|�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�}|�}|jt��tj|�}WdQRX|j|d�|�}tj|�}|j|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|j|jd�|j|j|j|jd�dS)Nrrr)rrrr�seq)rrrr�
test_indexfszSeqTestCase.test_indexcCsld|j_d|j_d|j_d|j_|j|j|j|j�|jdd��|j|j|j|j�|jdd��dS)Nr�rr)rrr5rr6rr7)rrrrrls$zSeqTestCase.test_slicecCs:t|j�}t|d�|j_|d|j_|j|j|jd�|jdd��|j|jd|j�|j�|j|j|jd�|jdd��|j|jd|j�|j�|d|j_t|d�|j_|j|j|jd�|j�|j|jd|j�|jdd��|j|j|jd�|j�|j|jd|j�|jdd��dS)Ng�?rr)	�lenr7r
rrrrr5r6)rZseqlenrrr�test_slice_bug7532ts
"""zSeqTestCase.test_slice_bug7532cCs|d|j_d|j_|j|j|j|jd�|j|j|j|jd�|j|j|j|jd�|j|j|j|jd�dS)Nr9r)rrrrr7)rrrr�test_repeat�szSeqTestCase.test_repeatcCs�d|j_d|j_|j|jj|j�|jd�|j|jj|j�|jd�|j|jj|j�|jd�|j|jj|j�|jd�|j|jj|j�|jd�|j|jj|j�|jd�dS)Nrr)rrrrr7�__getitem__�__mul__�__rmul__)rrrrr �szSeqTestCase.test_wrapperscCs|j|jt�|jd�dS)Nr)rr7r)rrrrr%�szSeqTestCase.test_subclassescCsld|j_d|j_dd�}|jt||j|�|jt||j|�dd�}|jt||j|�|jt||j|�dS)Nr&r'cSs
|j|S)N)r7)�x�objrrr�<lambda>�sz(SeqTestCase.test_error.<locals>.<lambda>cSs|j|d�S)N)r7)r@rArrrrB�s)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<|j|td��dddd	d
ddg}|j|jd
�|j|ddd
d	d
ddg�|j|j�|j|ddd	d
ddg�dS)Nrzab!cdefghi!j�X�YZ
abYdefghXjrrrr,�	r!��herer)rrrr"r�__setitem__�__delitem__)r�lstrrr�test_setdelitem�s

zListTestCase.test_setdelitemcCs�d|j_d|j_ddg}||j9}|j|ddddg�||j9}|j|ddddgd�dddddd	g}|j|j�}|j||�|j|dddddd	gd�dS)
Nrr9rrrrr,rJrK)rrrr�__imul__r-)rrO�l2rrr�test_inplace_repeat�s

z ListTestCase.test_inplace_repeatN)r	r
rr7rPrSrrrrrC�srCc@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)�reprrU)rrrr�__repr__�szNewSeq.__repr__cCs
|j|kS)N)rU)r�otherrrr�__eq__�sz
NewSeq.__eq__cCs
t|j�S)N)r:rU)rrrr�__len__�szNewSeq.__len__cCs|j|j|�S)N)�	__class__rU)rrrrrr>�szNewSeq.__mul__cCs
|j|S)N)rU)rrrrrr=�szNewSeq.__getitem__N)
r	r
rrWrYr[r\r>r?r=rrrrrT�srTc@seZdZdZdS)	�
TupleTestCaserr!rDrErFrGN)rr!rDrErFrG)r	r
rr7rrrrr^�sr^c@seZdZed�ZdS)�ByteArrayTestCasesthis is a testN)r	r
r�	bytearrayr7rrrrr_�sr_c@seZdZdZdS)�
BytesTestCasesthis is a testN)r	r
rr7rrrrra�srac@seZdZdZdS)�StringTestCasezthis is a testN)r	r
rr7rrrrrb�srbc@seZdZed�ZdS)	�NewSeqTestCaserr!rDrErFrGN)rr!rDrErFrG)r	r
rrTr7rrrrrc�srcc@seZdZdd�ZdS)�
RangeTestCasecCs>t�}d|_|jtdd�|d�|jtdd�j|�d�dS)NrrrDr)rrrr#r=)rrrrr�
test_range�szRangeTestCase.test_rangeN)r	r
rrerrrrrd�srdc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�OverflowTestCasecCsdd|_|j|_dS)Nr�d)�pos�neg)rrrrr�s
zOverflowTestCase.setUpcCs,|j|jj�|j�|j|jj�|j�dS)N)rrhrri)rrrr�test_large_longs�sz!OverflowTestCase.test_large_longscCs�Gdd�d�}|�}|j||j|j�|j||j|j�|j||j|j�jt�dtdf�|j||j|jd�jt�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�GetItemsrmrr)rrhrir�maxsize)rrmr@rrr�test_getitem�szOverflowTestCase.test_getitemcs,�jt�fdd���jt�fdd��dS)Ncs
d�jS)N�a)rhr)rrrrBsz7OverflowTestCase.test_sequence_repeat.<locals>.<lambda>cs
d�jS)Nrp)rir)rrrrBs)r(�
OverflowError)rr)rr�test_sequence_repeat
sz%OverflowTestCase.test_sequence_repeatN)r	r
rrrjrorrrrrrrf�srf�__main__)ZunittestZtestrrZMAX_Py_ssize_trnrr
rZTestCaserr4rCrTr^r_rarbrcrdrfr	�mainrrrr�<module>s$OF"