403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.164
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/list_tests.cpython-36.pyc
3

�w2_�I�@sFdZddlZddlZddlmZddlmZmZGdd�dej�ZdS)z,
Tests common to list and UserList.UserList
�N)�
cmp_to_key)�support�	seq_testscs�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.�Z�fd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z�ZS)9�
CommonTestcCs�|j|jg�|j��|jdddg�}|j�|j||jg��|jdddg�}|jdddg�|j||jdddg��|j|�}|jt|�t|��|j||�dS)N������)�assertEqual�	type2test�__init__ZassertNotEqual�id)�self�a�b�r�4/opt/alt/python36/lib64/python3.6/test/list_tests.py�	test_inits
zCommonTest.test_initc
Cs,d}|jt|��g}d|d<WdQRXdS)Nz'list indices must be integers or slices�pythonr)�assertRaisesRegex�	TypeError)r�msgrrrr�test_getitem_error!szCommonTest.test_getitem_errorcCs�g}dddg}|j|�}|j|�}|jt|�t|��|jt|�t|��|jt|�t|��|jt|�d�|jt|�d�|j|�|jd�|jt|�d�|jt|�d�dS)Nrrrz	[0, 1, 2]rz[0, 1, 2, [...], 3])r
r�str�repr�append)rZl0�l2Za0�a2rrr�	test_repr's




zCommonTest.test_reprcCsB|jg�}x$ttj�d�D]}|j|g�}qW|jtt|�dS)N�d)r
�range�sys�getrecursionlimit�assertRaises�RecursionErrorr)rr�irrr�test_repr_deep8s
zCommonTest.test_repr_deepcCs�|jtd��}|j|�|jtdd��|j|�|jd�zVttjd��}|jt|��WdQRXttjd��}|j	|j
�t|��WdQRXWdtj
tj�XdS)N��i��w�r)r
r"r�extend�openrZTESTFN�writerr�readr�os�remove)r�dZforrr�
test_print>s


"zCommonTest.test_printcCs�|jtd��}|jt|jtddd�dddg�|jt|jtdd�d�|jt|jtddd�ddg�|jt|jdd�dddg|tddd�<|j||jddddddd	d
ddddd
dddddddg��dS)N�r�
rrr�xr	r��	���
������)	r
r"r%�
ValueError�__setitem__�slicer�__getitem__r)rrrrr�test_set_subscriptLs zCommonTest.test_set_subscriptcCsz|jtd��}t|�}|jt|�|jtddd���|jtt|�|jtt|j���|j��|jtt	tdddg��dS)Nr4rArrr���rG)
r
r"�reversedr�listr%�
StopIteration�nextr�len)rrr+rrr�
test_reversedWs
zCommonTest.test_reversedc
Cs�|jddg�}d|d<d|d<|j||jddg��d|d<|j||jddg��d|d<|j||jddg��|jt|jdd�|jt|jdd�|jg�}|jt|jdd�|jt|jdd�|jt|j�|jdddddg�}d|d<d|d<d|d<|j||jdddddg��d|d<d	|d<d
|d<|j||jdd	d
ddg��d|d<d|d<|j||jdd	d
ddg��d
|d<d|d<|j||jdd	d
d
dg��d}|jt|��d|d<WdQRXdS)Nrrr!r)rrr	r
rr7�X�c�r8z'list indices must be integers or slicesrrrG������rGrQrGrQrG)r
rr%�
IndexErrorrCrr)rrrrrr�test_setitemas@
zCommonTest.test_setitemcCs�|jddg�}|d=|j|dg�|d=|j|g�|jddg�}|d=|j|dg�|d=|j|g�|jddg�}|jt|jd�|jt|jd�|jg�}|jt|jd�|jt|j�dS)NrrrrrQrGrR)r
rr%rS�__delitem__r)rrrrr�test_delitem�s 
zCommonTest.test_delitemc
Cs�ddg}|j|�}�x
tdd�D]�}|d|�|d|�<|j||�|dd�}|d|�|d|�<|j||�||d�||d�<|j||�|dd�}||d�||d�<|j||�x^td	d�D]P}|||�|||�<|j||�|dd�}|||�|||�<|j||�q�Wq W|dd�}d
dg|dd�<|j|dd
ddg�g|dd�<|j|g�|jdddddg�}||dd�<|j||jddddddg��|jdddddg�}||dd�<|j||jddddddg��|jdddddg�}||dd�<|j||jdddddddg��|jg�}ttd��|dd�<|j||jtd���|jt|jtddd��|jt|j�dS)Nrrrr	rr
r5rRrRrQrGrQrGrGrG)r
r"r�tupler%rrCrD)r�lrr'r�jZaa2rrr�
test_setslice�sL
 
zCommonTest.test_setslicecCs�|jddg�}|dd�=|dd�=|j||jg��|jddg�}|dd�=|dd�=|j||jg��|jddg�}|dd�=|j||jdg��|jddg�}|dd�=|j||jdg��|jddg�}|dd�=|dd�=|j||jg��|jddg�}|dd�=|dd�=|j||jg��|jddg�}|dd�=|j||jdg��|jddg�}|d	d�=|j||jdg��|jddg�}|dd�=|j||jg��dS)
NrrrrQrGrQrGrGrG)r
r)rrrrr�
test_delslice�s>












zCommonTest.test_delslicecCsR|jg�}|jd�|jd�|jd�|j||jdddg��|jt|j�dS)Nrrr)r
rrr%r)rrrrr�test_append�s



zCommonTest.test_appendc	Cs
|jdg�}|jd�}|dd�}|j|�|j|||�|j|jg��|j|||�|j|�|j||jddddddg��|jd�}|jd�|j|td��|jt|jd�|jt|j�Gdd�d�}|jddd	d
g�}|j|��|j|ddd	d
g�dS)Nrr�spam�eggs�spameggsc@s$eZdZdd�Zdd�Zdd�ZdS)z*CommonTest.test_extend.<locals>.CustomItercSs|S)Nr)rrrr�__iter__sz3CommonTest.test_extend.<locals>.CustomIter.__iter__cSst�dS)N)rJ)rrrr�__next__sz3CommonTest.test_extend.<locals>.CustomIter.__next__cSstjS)N)r#�maxsize)rrrr�__length_hint__sz:CommonTest.test_extend.<locals>.CustomIter.__length_hint__N)�__name__�
__module__�__qualname__r`rarcrrrr�
CustomItersrgrrr	)rr)r
r,rrIr%r)rZa1rrrgrrr�test_extend�s$




zCommonTest.test_extendcCs�|jdddg�}|jdd�|jdd	�|jdd�|j|d
dddddg�|dd�}|jdd�|jd
d�|jdd�|j||jdddddddddg	��|jt|j�dS)NrrrZfoor)�left�rightrQrGrQrGrQi8���rQrG)r
�insertrr%r)rrrrrr�test_inserts$zCommonTest.test_insertcCs�|jd	ddg�}|j�|j|d
dg�|jd�|j|dg�|jt|jd�|jd�|j|g�|jt|j�|jt|jdd�|jdddddg�}dS)Nrrr
�*r5r4��(rGrG)r
�poprr%rSr)rrrrr�test_pop,s

zCommonTest.test_popcs�|jdddg�}|jd�|j|ddg�|jd�|j|dg�|jd�|j|g�|jt|jd�|jt|j�Gdd�dt��G�fdd�d�}|jddddg�}|j�|j|��G�fd	d
�d
�}|jd�}|jd�|j||jd
��|jd�|j||jd��|jt|jd�|j||jd��|jdd|�dg�}|j|�}|j�|jd�x$t||�D]\}}|j||��qlWdS)Nrrc@seZdZdS)z&CommonTest.test_remove.<locals>.BadExcN)rdrerfrrrr�BadExcFsrrcseZdZ�fdd�ZdS)z&CommonTest.test_remove.<locals>.BadCmpcs|dkr���dS)NrFr)r�other)rrrr�__eq__Jsz-CommonTest.test_remove.<locals>.BadCmp.__eq__N)rdrerfrtr)rrrr�BadCmpIsrurrcseZdZ�fdd�ZdS)z'CommonTest.test_remove.<locals>.BadCmp2cs
���dS)Nr)rrs)rrrrrtSsz.CommonTest.test_remove.<locals>.BadCmp2.__eq__N)rdrerfrtr)rrrr�BadCmp2RsrvZabcdefghcij�cZ
abdefghcijZ	abdefghijrr)	r
r1rr%rBr�	Exception�zip�assertIs)rrrurvr2�er6�yr)rrr�test_remove9s4






zCommonTest.test_removecs�|jdddg�d}|j|jd�d�|j|jd�d�|j|jd�d�|jt|j�Gdd�dt��G�fdd�d�}|j�|j|��dS)	Nrrrrc@seZdZdS)z%CommonTest.test_count.<locals>.BadExcN)rdrerfrrrrrrnsrrcseZdZ�fdd�ZdS)z%CommonTest.test_count.<locals>.BadCmpcs|dkr���dS)NrFr)rrs)rrrrrtrsz,CommonTest.test_count.<locals>.BadCmp.__eq__N)rdrerfrtr)rrrrruqsru)r
r�countr%rrx)rrrur)rrr�
test_countfszCommonTest.test_countcs�|jddg�}|j|jd�d�|j|jd�d�|jt|jd�|jddddddg�}|j|jd�d�|j|jd�d�|j|jdd�d�|j|jdd�d�|j|jdd�d�|j|jddd�d�|jt|jddd�|jt|j�Gdd�dt��G�fd	d
�d
�}|jddddg��|j��j|��|jddddddg��|j�jd�d�|j�jdd�d�|j�jdd�d�|j�jdd�d�|j�jdd�d�|j�jdd�d�|j�jddd�d�|j�jddd�d�|j�jddtj	dtj	�d�|jt�jddtj	dtj	�|jt�jddd��j
d�|jt�jddd�|j�|jd d!dddg��Gdd�d��|j����fd
d�td�D��dd�<|jt�jd�dS)"Nrrrr5rr	c@seZdZdS)z%CommonTest.test_index.<locals>.BadExcN)rdrerfrrrrrr�srrcseZdZ�fdd�ZdS)z%CommonTest.test_index.<locals>.BadCmpcs|dkr���dS)NrFr)rrs)rrrrrt�sz,CommonTest.test_index.<locals>.BadCmp.__eq__N)rdrerfrtr)rrrrru�sruc@seZdZdd�Zdd�ZdS)z&CommonTest.test_index.<locals>.EvilCmpcSs
||_dS)N)�victim)rr�rrrr�sz/CommonTest.test_index.<locals>.EvilCmp.__init__cSs|jdd�=dS)NF)r�)rrsrrrrt�sz-CommonTest.test_index.<locals>.EvilCmp.__eq__N)rdrerfrrtrrrr�EvilCmp�sr�csg|]}����qSrr)�.0�_)r�rrr�
<listcomp>�sz)CommonTest.test_index.<locals>.<listcomp>r!rQrGrQi����i����rQrG���rQi����rRrRrQr�r�i����rQrG)r
r�indexr%rBr~rrxr#rbr1r")r�urur)rrr�rr�
test_indexysH" 
 zCommonTest.test_indexcCsf|jdddddg�}|dd�}|j�|j|dddddg�|j�|j||�|jt|jd�dS)	NrrrrmrQrGrGrQ)r
�reverserr%r)rr��u2rrr�test_reverse�szCommonTest.test_reversecCs�|jdddg�}|j�|j|g�|jg�}|j�|j|g�|jg�}|jd�|j�|jd�|j|dg�|jt|jd�dS)Nrrr	r)r
�clearrrr%r)rr�rrr�
test_clear�s



zCommonTest.test_clearcCs�|jdddg�}|j�}|j|dddg�|jg�}|j�}|j|g�|jddg�}|j�}|jd�|j|ddg�|j||dg�|jddddgdg�}|j�}|j||�|j|d|d�|jt|jd�dS)	Nrrrrrr'r	r
)r
�copyrrrzr%r)rr��vrrr�	test_copy�s 

zCommonTest.test_copycs|jddg�}|j�|j|ddg�|jdddd
dg�}|j�|j||jdddddg��|jt|jdd�dd�}|jt|�d�|j||jdddddg��dd	�}|jtd
����jt|�d�|jt�jd��fdd�}|jt�jt|�d�|jt�jdddd�dS)NrrrrmcSs ||krdS||krdSdSdS)NrrrGr)rrrrr�revcmp�s
z$CommonTest.test_sort.<locals>.revcmp)�keycSs2|d|d}}||krdS||kr*dSdSdS)Nrr7rrrGr)r6r|ZxmodZymodrrr�myComparison�sz*CommonTest.test_sort.<locals>.myComparisonr:cs*�jd�||krdS||kr"dSdSdS)NrrrG)r)r6r|)�zrr�selfmodifyingComparisons
z5CommonTest.test_sort.<locals>.selfmodifyingComparisonrGrQrQrGrGrQ)r
�sortrr%rrr"rB)rr�r�r�r�r)r�r�	test_sort�s$
zCommonTest.test_sortcCs*|jd�}d|dd�<|j|td��dS)Nr]�hrZham)r
rrI)rr�rrr�
test_slices
zCommonTest.test_slicecslt�j�|jddg�}|}|ddg7}|j||�|jd�}|d7}|j||jd��|jt|jd�dS)Nrrrrr]r^r_)�super�	test_iaddr
rzrr%r�__iadd__)rr�r�)�	__class__rrr�s

zCommonTest.test_iaddc	Cs||jddg�}|d9}|j||jddddddg��|d9}|j||jg��|jg�}t|�}|d9}|jt|�|�dS)Nrrrr5)r
rr)rr��sZoldidrrr�	test_imul's
zCommonTest.test_imulc
Cs�|jdddddg�}|ddd�=|j||jddg��|jtd��}|ddd�=|j||jdddg��|jtd��}|ddd�=|j||jddddg��|jtd��}|ddd�=|j||jdddddd	d
ddg	��|jtd��}dgd|ddd�<|j||jdddddddd
ddg
��|jtd��}dgd|ddd�<|j||jddddddd	d
ddg
��|jtd��}||ddd�<|j||jddddg��|jtd��}|dd�}|dd�}|jd
dg�|dd�<|jd
dg�|tdd�<|jd
dg�|dd�<|j||�|j||�|jtd��}ttd��|ddd�<|j||jdddddddd
ddg
��|jtd��}|dddd>�=dS)Nrrrrr	r
r5i�rr7rPr8Ztwo�elementsiMrQrGrGrGrGrGrGr�rG)r
rr"rDrW)rrrrwrrr�test_extendedslicing2sD$&&&zCommonTest.test_extendedslicingcCs$Gdd�dt�}|jtt|��dS)Nc@seZdZdd�ZdS)z9CommonTest.test_constructor_exception_handling.<locals>.FcSst�dS)N)�KeyboardInterrupt)rrrrr`^szBCommonTest.test_constructor_exception_handling.<locals>.F.__iter__N)rdrerfr`rrrr�F]sr�)�objectr%r�rI)rr�rrr�#test_constructor_exception_handling[sz.CommonTest.test_constructor_exception_handlingcCs�|jdddg�}t|�}t|�}x|D]}t|�q&W|jd�|jt|�g�|jt|�dg�|j||jddddg��dS)Nrrrr8)r
�iterrKrrrI)rrZexhitZempitr6rrr�test_exhausted_iteratorbs

z"CommonTest.test_exhausted_iterator) rdrerfrrr r(r3rFrMrTrVrZr[r\rhrlrqr}rr�r�r�r�r�r�r�r�r�r�r��
__classcell__rr)r�rrs8
%.)	!
-9
0
)r)	�__doc__r#r0�	functoolsrZtestrrrrrrr�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit