Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_int.cpython-310.pyc
o

�9jHq�@s�ddlZddlZddlZddlmZddlmZmZdddddd	d
ddd
eej	�ej	fde
fdde
fde
fde
fde
fde
fgZGdd�de�Z
Gdd�dej�ZGdd�dej�ZGdd�de�Zedkrle��dSdS)�N)�support)�VALID_UNDERSCORE_LITERALS�INVALID_UNDERSCORE_LITERALS)�0r)�1�)�9�	)�10�
)�99�c)�100�d)�314�:)z 314r)z314 r)z  		  314  		  rz  1x)z  1  rz  1  �� �  		  uȀc@�eZdZdS)�IntSubclassN��__name__�
__module__�__qualname__�rr�$/usr/lib/python3.10/test/test_int.pyr�rc@s�eZdZdd�Zdd�Zejdd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�IntTestCasescCsB	|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td	�d�|�td
�d�|�td�d�|�td�d�|�td
d�d�tD]4\}}dD]-}dD](}|||}|}|dkrz|turz|}z
|�t|�|�Wqety�Yqewqaq[tdtj�}t|�}|�|dtj�|�|t�|�t|dd��tjd�td�}|�|t�td�}|�|t�dtj}|�|d?|d�td�}|�|t�|�t	tdd�|�tdd�d�|�tdd�d�|�ttdd�|�ttdd�|�ttdd �|�ttdd�|�ttd!d�|�ttd!d�|�td"d�d#�|�td$d�d#�|�td%d&�d#�|�td'd(�d#�|�td)d*�d#�|�td+d,�d#�|�td-d �d#�|�td.d/�d#�|�td0d1�d#�|�td2d3�d#�|�td4d�d#�|�td5d6�d#�|�td7d8�d#�|�td9d:�d#�|�td;d�d#�|�td<d=�d#�|�td>d?�d#�|�td@dA�d#�|�tdBdC�d#�|�tdDdE�d#�|�tdFdG�d#�|�tdHdI�d#�|�tdJdK�d#�|�tdLdM�d#�|�tdNdO�d#�|�tdPdQ�d#�|�tdRdS�d#�|�tdTdU�d#�|�tdVdW�d#�|�tdXdY�d#�|�tdZd[�d#�|�td\d]�d#�|�td^d_�d#�|�td`da�d#�|�tdbdc�d#�|�tddd�d�|�tddd�d�|�tded�d�|�tdd�d�|�tdd�d�|�tdfd�d&�|�tdgd�d�|�tdhd�d�|�tdid�d&�|�tdj�dk�|�tdjd1�dk�|�tdd�d�|�tdd �d�|�tdfd�d&�|�tdld�d�|�tdmd �d�|�tdnd�d&�|�ttdod�|�ttdpd�|�ttdqd�|�ttdrd�|�ttdsd �|�ttdtd �|�ttdud �|�ttdvd �|�ttdwd�|�ttdxd�|�ttdyd�|�ttdzd�|�td{d�d|�|�td}d�d|�|�td~d&�d|�|�tdd(�d|�|�td�d*�d|�|�td�d,�d|�|�td�d �d|�|�td�d/�d|�|�td�d1�d|�|�td�d3�d|�|�td�d�d|�|�td�d6�d|�|�td�d8�d|�|�td�d:�d|�|�td�d�d|�|�td�d=�d|�|�td�d?�d|�|�td�dA�d|�|�td�dC�d|�|�td�dE�d|�|�td�dG�d|�|�td�dI�d|�|�td�dK�d|�|�td�dM�d|�|�td�dO�d|�|�td�dQ�d|�|�td�dS�d|�|�td�dU�d|�|�td�dW�d|�|�td�dY�d|�|�td�d[�d|�|�td�d]�d|�|�td�d_�d|�|�td�da�d|�|�td�dc�d|�dS)�Nrg��Q�	@�g��Q�	����g333333@g333333�g@g�z-3z -3 u -3 r
�)r�+�-)rr�	rr#���rg}Ô%�I�Tg}Ô%�I����X111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111��0o123r�S�0x123i#�0x�0o��0b�!100000000000000000000000000000000l�102002022201221111211�10000000000000000��32244002423141��
1550104015504��211301422354��40000000000�12068657454r	�
4294967296r�
1904440554��	9ba461594�	535a79889�
�	2ca5b7464��	1a20dcd81��	100000000�a7ffda91��704he7g4��4f5aff66��3723ai4g��281d55i4��1fj8b184��1606k7ic��mb994ag��hek2mgl��dnchbnm��b28jpdm��8pfgih4��76beigg��5qmcpqg��4q0jto4��4000000� �3aokq94�!�2qhxjli�"�2br45qb�#�1z141z4�$z 0o123  �000�0b100z	 0O123   z 0X123  z 0B100 �0123�{�0X123�0O123�0B100�0b2�0b02�0B2�0B02�0o8�0o08�0O8�0O08�0xg�0x0g�0Xg�0X0g�!100000000000000000000000000000001l�102002022201221111212�10000000000000001�32244002423142�
1550104015505�211301422355�40000000001�12068657455�
4294967297�
1904440555�	9ba461595�	535a7988a�	2ca5b7465�	1a20dcd82�	100000001�a7ffda92�704he7g5�4f5aff67�3723ai4h�281d55i5�1fj8b185�1606k7id�mb994ah�hek2mgm�dnchbnn�b28jpdn�8pfgih5�76beigh�5qmcpqh�4q0jto5�4000001�3aokq95�2qhxjlj�2br45qc�1z141z5)
�assertEqual�int�L�
ValueError�repr�sys�maxsize�assertIsInstance�assertRaises�	TypeError)�self�s�v�sign�prefix�ss�vv�xrrr�
test_basic#s$���
zIntTestCases.test_basicc	s�tD])�t�fdd�dD��rq|�t�d�t���|�t�d�t��dd�d��qtD]�t�fdd�dD��r<q.|�tt�d�q.|�tdd	�d
�|�td�d�|�td
�d�|�ttd�|�ttd�|�ttd�|�ttd�dS)Nc3��|]}|�vVqdS�Nr��.0�ch��litrr�	<genexpr>���z0IntTestCases.test_underscores.<locals>.<genexpr>z.eEjJr�_rc3r�r�rr�r�rrr��r��1_00rr	�0_100rs1_00�_100z+_100�1__00�100_)	r�anyr�r��eval�replacerr�r��r�rr�r�test_underscores�s "zIntTestCases.test_underscorescCsD|�td�d�|�td�d�|�td�d�|�td�d�dS)Nr
rz-1r%s10s-1)�assertIsr�r�rrr�test_small_ints�szIntTestCases.test_small_intscCs|�t�d�dS)Nr�r�r�r�rrr�test_no_args��zIntTestCases.test_no_argscCs�|�tddd�d�|�td��
tdd�Wd�n1s wY|�td��tddd�Wd�n1s<wY|jttd	d�|jttd
d�dS)Nrr&��baser3zkeyword argumentg333333�?)r�)r�r�rr)r�r��assertRaisesRegexr�r�r�rrr�test_keyword_args�s��zIntTestCases.test_keyword_argscCsN|�tdd�d�|�t��
tdd�Wd�n1swY|�t��
tdd�Wd�n1s8wY|�t��
tdd�Wd�n1sRwY|�t��tdddd	d
�Wd�n1sqwY|�t��tddd	d
�Wd�n1s�wYtdd�D]}|�td|d
�d�q�dS)z9Testing the supported limits of the int() base parameter.rr5rrN�%is���r&��r�)r�r�r�r��range�r�r�rrr�test_int_base_limitss&������z!IntTestCases.test_int_base_limitscCsn|�t��
tdd�Wd�n1swY|�t��tdd�Wd�dS1s0wYdS)z2Not integer types are not valid bases; issue16772.rg@Ng@)r�r�r�r�rrr�test_int_base_bad_typess�"�z$IntTestCases.test_int_base_bad_typesc	Cs�Gdd�dt�}ddddddfD]}|�t��
td|�Wd�n1s*wYq|�td|d�d	�d
�|�td|d�d	�d�|�td|d
�d	�d�dS)Nc@�eZdZdd�Zdd�ZdS)z9IntTestCases.test_int_base_indexable.<locals>.MyIndexablecSs
||_dSr���value)r�r�rrr�__init__s
zBIntTestCases.test_int_base_indexable.<locals>.MyIndexable.__init__cSs|jSr�r�r�rrr�	__index__�zCIntTestCases.test_int_base_indexable.<locals>.MyIndexable.__index__N)rrrr�r�rrrr�MyIndexable�r�r&rrr��43�101r�r5r�erni)�objectr�r�r�r�)r�r�r�rrr�test_int_base_indexables��z$IntTestCases.test_int_base_indexablec
shGdd�dt��Gdd�dt�}Gdd�dt�}tt�fdd�||tg}zd	d
lm�Wn	ty5Yn
w|��fdd��|D]p}|d�}|�t|���[|�	t
|�d
�t|tttf�ri|�	t
|d�d�nd}|�t
|��
t
|d�Wd�n1s�wY|�td��t
|d��Wd�n1s�wYWd�n1s�wYqAdS)Nc@r)z<IntTestCases.test_non_numeric_input_types.<locals>.CustomStrNrrrrr�	CustomStr.�r�c@r)z>IntTestCases.test_non_numeric_input_types.<locals>.CustomBytesNrrrrr�CustomBytes/r�r�c@r)zBIntTestCases.test_non_numeric_input_types.<locals>.CustomByteArrayNrrrrr�CustomByteArray0r�r�cs�|���Sr�)�decode��b)r�rr�<lambda>5r�z;IntTestCases.test_non_numeric_input_types.<locals>.<lambda>r��arraycs
�d|�S)N�Brr�r�rrr�?s
s100rr&r3zcan't convert non-stringzinvalid literalsAAAAAAAAAAAAAAAA)�str�bytes�	bytearray�
memoryviewr��ImportError�append�subTest�typer�r��
isinstancer�r�r�)r�r�r��	factories�fr��msgr)r�r�r�test_non_numeric_input_types+sB
��������z)IntTestCases.test_non_numeric_input_typescCs�|�ttd�dd��d�|�ttd�dd��d�|�ttd�dd��d�|�ttd�dd��d�|�ttd�dd��d�dS)	Ns123rrrT�123s123 s123As1234)r�r�r�r�rrr�test_int_memoryviewNs
 z IntTestCases.test_int_memoryviewcCs|�ttd�dS)Nz1.2)r�r�r�r�rrr�test_string_floatUr�zIntTestCases.test_string_floatcsZGdd�d�}|�tt|��Gdd�dt�}|�tt|��Gdd�d�}|�t|��d�Gdd	�d	�}t|fD]�}Gd
d�d|�}|�t|��d�Gdd
�d
|�}|�t|��d�Gdd�d|�}|�t��
t|��Wd�n1s{wYt|fD]�}	Gdd�d|	��G�fdd�d|�}
|�t|
��d�Gdd�d|	��G�fdd�d|�}|�t|
��d�G�fdd�d|	��G�fdd�d|�}zt|��Wnty�}
z|�t|
�d�WYd}
~
nd}
~
ww|�d||	ff�Gdd�d|	��G�fd d!�d!|�}|�t��
t|��Wd�n	1�s$wYq�q:dS)"Nc@r)z>IntTestCases.test_intconversion.<locals>.ClassicMissingMethodsNrrrrr�ClassicMissingMethodsZrrc@r)z7IntTestCases.test_intconversion.<locals>.MissingMethodsNrrrrr�MissingMethods^rrc@�eZdZdd�ZdS)z-IntTestCases.test_intconversion.<locals>.Foo0cS�dS�N�*rr�rrr�__int__c�z5IntTestCases.test_intconversion.<locals>.Foo0.__int__N�rrrr	rrrr�Foo0b�rrc@r)z0IntTestCases.test_intconversion.<locals>.ClassicNrrrrr�Classichrrc@r�)z:IntTestCases.test_intconversion.<locals>.IntOverridesTrunccSrrrr�rrrr	lr
zBIntTestCases.test_intconversion.<locals>.IntOverridesTrunc.__int__cSr)Ni�rr�rrr�	__trunc__nr
zDIntTestCases.test_intconversion.<locals>.IntOverridesTrunc.__trunc__N)rrrr	rrrrr�IntOverridesTrunckr�rc@r)z2IntTestCases.test_intconversion.<locals>.JustTrunccSrrrr�rrrrsr
z<IntTestCases.test_intconversion.<locals>.JustTrunc.__trunc__N�rrrrrrrr�	JustTruncrr
rc@r)z9IntTestCases.test_intconversion.<locals>.ExceptionalTrunccSsdddS)Nrrrr�rrrrxszCIntTestCases.test_intconversion.<locals>.ExceptionalTrunc.__trunc__Nrrrrr�ExceptionalTruncwr
rc@r)z.IntTestCases.test_intconversion.<locals>.IndexcSrrrr�rrrr�r
z8IntTestCases.test_intconversion.<locals>.Index.__index__N�rrrr�rrrr�Index~r
rc�eZdZ�fdd�ZdS)z;IntTestCases.test_intconversion.<locals>.TruncReturnsNonIntc���Sr�rr��rrrr�r�zEIntTestCases.test_intconversion.<locals>.TruncReturnsNonInt.__trunc__Nrrrrr�TruncReturnsNonInt��rc@r)z0IntTestCases.test_intconversion.<locals>.IntablecSrrrr�rrrr	�r
z8IntTestCases.test_intconversion.<locals>.Intable.__int__Nrrrrr�Intable�r
rcr)z=IntTestCases.test_intconversion.<locals>.TruncReturnsNonIndexcrr�rr��rrrr�r�zGIntTestCases.test_intconversion.<locals>.TruncReturnsNonIndex.__trunc__Nrrrrr�TruncReturnsNonIndex�rrcr)z4IntTestCases.test_intconversion.<locals>.NonIntegralcrr�rr���NonIntegralrrr�sz>IntTestCases.test_intconversion.<locals>.NonIntegral.__trunc__Nrrrrrr�rrcr)z@IntTestCases.test_intconversion.<locals>.TruncReturnsNonIntegralcrr�rr�rrrr�r�zJIntTestCases.test_intconversion.<locals>.TruncReturnsNonIntegral.__trunc__Nrrrrr�TruncReturnsNonIntegral�rr z2__trunc__ returned non-Integral (type NonIntegral)z!Failed to raise TypeError with %sc@r)z/IntTestCases.test_intconversion.<locals>.BadIntcSr�NgE@rr�rrrr	�r
z7IntTestCases.test_intconversion.<locals>.BadInt.__int__Nrrrrr�BadInt�r
r"cr)z;IntTestCases.test_intconversion.<locals>.TruncReturnsBadIntcrr�rr��r"rrr�r�zEIntTestCases.test_intconversion.<locals>.TruncReturnsBadInt.__trunc__Nrrr#rr�TruncReturnsBadInt�rr$)r�r�r�r�r��ZeroDivisionErrorr��fail)r�rrrrr�rrr�trunc_result_baserrr �er$r)r"rrrr�test_intconversionXsX�
��������zIntTestCases.test_intconversioncCsZGdd�dt�}Gdd�dt�}|d�}|�|d�|�t|�d�|�t|��d�dS)Nc@r)z:IntTestCases.test_int_subclass_with_index.<locals>.MyIndexcSrrrr�rrrr��r
zDIntTestCases.test_int_subclass_with_index.<locals>.MyIndex.__index__Nrrrrr�MyIndex�r
r*c@r)z;IntTestCases.test_int_subclass_with_index.<locals>.BadIndexcSrr!rr�rrrr��r
zEIntTestCases.test_int_subclass_with_index.<locals>.BadIndex.__index__Nrrrrr�BadIndex�r
r+r9r)r�r�)r�r*r+�my_intrrr�test_int_subclass_with_index�sz)IntTestCases.test_int_subclass_with_indexcCsjGdd�dt�}Gdd�dt�}|d�}|�|d�|�t|�d�|d�}|�|d�|�tt|�dS)Nc@r)z6IntTestCases.test_int_subclass_with_int.<locals>.MyIntcSrrrr�rrrr	�r
z>IntTestCases.test_int_subclass_with_int.<locals>.MyInt.__int__Nrrrrr�MyInt�r
r.c@r)z7IntTestCases.test_int_subclass_with_int.<locals>.BadIntcSrr!rr�rrrr	�r
z?IntTestCases.test_int_subclass_with_int.<locals>.BadInt.__int__Nrrrrrr"�r
r"r9r)r�r�r�r�)r�r.r"r,rrr�test_int_subclass_with_int�sz'IntTestCases.test_int_subclass_with_intc	sNGdd�d��Gdd�dt�}Gdd�d��Gdd�dt�}G�fd	d
�d
�}G�fdd�d�}Gd
d�d�}��}|�t��t|�}Wd�n1sNwY|�|d�|�t|�t�|�}t|�}|�|d�|�t|�t���}|�t��t|�}Wd�n1s�wY|�|d�|�t|�t�|�}|�t��t|�}Wd�n1s�wY|�|d�|�t|�t�|�}|�t��t|�}Wd�n1s�wY|�|d�|�t|�t�|�}|�tt|�|�}t|�}|�|d�|�t|�t�t|�}|�|d�|�t|�t�dS)Nc@r)z<IntTestCases.test_int_returns_int_subclass.<locals>.BadIndexcSr�NTrr�rrrr��r
zFIntTestCases.test_int_returns_int_subclass.<locals>.BadIndex.__index__Nrrrrrr+�r
r+c@r)z=IntTestCases.test_int_returns_int_subclass.<locals>.BadIndex2cSrr0rr�rrrr��r
zGIntTestCases.test_int_returns_int_subclass.<locals>.BadIndex2.__index__Nrrrrr�	BadIndex2�r
r1c@r)z:IntTestCases.test_int_returns_int_subclass.<locals>.BadIntcSrr0rr�rrrr	�r
zBIntTestCases.test_int_returns_int_subclass.<locals>.BadInt.__int__Nrrrrrr"�r
r"c@r)z;IntTestCases.test_int_returns_int_subclass.<locals>.BadInt2cSrr0rr�rrrr	�r
zCIntTestCases.test_int_returns_int_subclass.<locals>.BadInt2.__int__Nrrrrr�BadInt2�r
r2cr)zHIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadIndexcrr�rr��r+rrr�r�zRIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadIndex.__trunc__Nrrr3rr�TruncReturnsBadIndex�rr4cr)zFIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadIntcrr�rr�r#rrr�r�zPIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsBadInt.__trunc__Nrrr#rrr$�rr$c@r)zKIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsIntSubclasscSrr0rr�rrrr�r
zUIntTestCases.test_int_returns_int_subclass.<locals>.TruncReturnsIntSubclass.__trunc__Nrrrrr�TruncReturnsIntSubclass�r
r5rr)	r��assertWarns�DeprecationWarningr�r�r�r�r�r)	r�r1r2r4r$r5�bad_int�n�good_intr)r+r"r�test_int_returns_int_subclass�sX
�
�
�
�z*IntTestCases.test_int_returns_int_subclasscs�d�fdd�	}|d�|d�|d�|d�|dd�|dd	�|dd
�|dd	�|dd
�|d�|dd�|d
�|d
d�|d�|dd�dS)Ncs~�jtd||fd��}|durt|�nt||�Wd�n1s$wY��|jjdd|dur7dn||f�dS)Nzint(%r, %r))r�rz*invalid literal for int() with base %d: %rr)r�r�r�r��	exception�args)r�r��cmr�rr�checks
�

����z.IntTestCases.test_error_message.<locals>.check�½u123½z  123 456  z123rz123 245rNr!z123245rs123�u123�r�r)r�r?rr�r�test_error_messages 






zIntTestCases.test_error_messagecCsL|�tdd�d�|�tdd�d�|�tdd�d	�|�td
d�d�dS)
N�=1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1_0_1r&iUUUU�1_2_3_4_5_6_7_0_1_2_3r.iSp�S�1_2_3_4_5_6_7_8_9r!l�g�F�
1_2_3_4_5_6_7rfi�2Dr�r�rrr�test_issue316194s�zIntTestCases.test_issue31619N)rrrr�r�r�cpython_onlyr�r�r�r�r�r�r�rrr)r-r/r;rArFrrrrr!s(8

#VE!rcs�eZdZeZ�fdd�Z�fdd�Zdd�Zdd�Zdd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Z�ZS)�IntStrDigitLimitsTestscs"t���t��|_t�d�dS)Ni)�super�setUpr��get_int_max_str_digits�_previous_limit�set_int_max_str_digitsr���	__class__rrrJ@s

zIntStrDigitLimitsTests.setUpcst�|j�t���dSr�)r�rMrLrI�tearDownr�rNrrrPEszIntStrDigitLimitsTests.tearDowncCs�|�t��d�|�t��d�t�d��|�t��d�|�dd�}t|�Wd�n1s3wY|�t��d�dS)Nri Nr)	�
assertGreaterr�rK�
assertLessr�adjust_int_max_str_digitsr��	int_classr�)r��irrr�test_disabled_limitIs
�z*IntStrDigitLimitsTests.test_disabled_limitcCsz|j}t��}|d|�|dd|�|d|d�|dd|�|dd|�|�ttd|d��|�dS)z&Ignore the +/- sign and space padding.rrr"r#rrN)rTr�rKr��lenr�)r�rT�	maxdigitsrrr�test_max_str_digits_edge_casesRs z5IntStrDigitLimitsTests.test_max_str_digits_edge_casesNcCs`|�t��!|dur|�|�n|�||�Wd�dSWd�dS1s)wYdSr�)r�r�rT)r�rUr�rrrr?^s�"�zIntStrDigitLimitsTests.checkcCs�t��}|�d|d�|�dd|d�|�d|dd�|�dd|d�|�dd|d�|�d|d�d|}|�t��
t|�Wd�dS1s[wYdS)Nrrrr"r#r)r�rKr?r�r�r�)r�rXrUrrr�test_max_str_digitses
"�z*IntStrDigitLimitsTests.test_max_str_digitsc	Cs�t��}|dksJ|��tj}|�dkrtj}tddd��dd�}d}t�|��|�}t|�}Wd	�n1s;wY|�|}|�	t
|�|�|d
krZt�d|�d���t�td
|���)|�
t��}|�}t|�Wd	�n1s{wY|�|}	Wd	�n1s�wY|�dt|j��|�|	|d�tddd��dd�}
|�
t��}|�}t|
�Wd	�n1s�wY|�|}|�dt|j��|�||d�d	S)�?Regression test: ensure we fail before performing O(N**2) work.iP�rr,�ci�r!r�i�1N��?�"slow" conversion took only �	 seconds.gףp=
��?�
conversionr&i �)r�rK�time�process_time�	monotonicr�rrSr�r�rW�unittest�SkipTestr�r��assertInr<�assertLessEqualrR)r�rX�get_time�huge_int�digits�start�huge_decimal�seconds_to_convert�err�seconds_to_fail_huge�extra_huge_int�seconds_to_fail_extra_hugerrr�+test_denial_of_service_prevented_int_to_strssD

�

�
��
�
zBIntStrDigitLimitsTests.test_denial_of_service_prevented_int_to_strc	Cs�t��}|dksJ|��tj}|�dkrtj}d}d|}t�|��|�}t|�Wd�n1s4wY|�|}|dkrKt�	d|�d���t�|d	��)|�
t��}|�}t|�Wd�n1sjwY|�|}Wd�n1s~wY|�d
t
|j��|�||d�dd
}	|�
t��}|�}t|	�Wd�n1s�wY|�|}
|�d
t
|j��|�|
|d�dS)r[順riD
�8Nr]r^r_rr`r&�7i�O)r�rKrarbrcrrSr�rdrer�r�rfr�r<rg)r�rXrhrj�hugerkrmrnro�
extra_hugerqrrr�+test_denial_of_service_prevented_str_to_int�sB

�

�
��
�
zBIntStrDigitLimitsTests.test_denial_of_service_prevented_str_to_intc	Csrt��}dD]0}|j|d�� |�d|d|�|dksJ�|�dd|�Wd�n1s1wYqdS)z-The limit does not apply to power of 2 bases.)r&r3r.r!rfr�rrrsN)r�rKr�rT)r�rXr�rrr�!test_power_of_two_bases_unlimited�s���z8IntStrDigitLimitsTests.test_power_of_two_bases_unlimitedcCsXt��}|d}d|}d|}|�|�|�|�|�|�d��|�|�d��dS)Nr�111�1_11�_111)r�rKrTr?)r�rX�triplesr��s_rrr�test_underscores_ignored�s

z/IntStrDigitLimitsTests.test_underscores_ignoredcCsh|j}t��}d|}||�}|d|���}||ksJ�|d|���}||ks*J�t|�t|�dS)N�5r"r#)rTr�rKr�)r�rT�
max_digitsr�rU�pos_i�neg_irrr�test_sign_not_counted�sz,IntStrDigitLimitsTests.test_sign_not_countedcCs�|j}t��}d|}|||�}|dkr.|�t��t|�Wd�n1s(wYn|dkr6t|�|�t��}||�d�|�Wd�dS1sOwYdS)N�2rr)rTr�rKr�r�r�)r�r�rTr�r�rUrnrrr�_other_base_helper�s

��"�z)IntStrDigitLimitsTests._other_base_helpercCszd}|j|d��
|�|�Wd�n1swYd}|j|d��|�|�Wd�dS1s6wYdS)Nrr�rn)r�r�r�rrr�test_int_from_other_bases�s�"�z0IntStrDigitLimitsTests.test_int_from_other_basesr�)rrrr�rTrJrPrVrYr?rZrrrxryrr�r�r��
__classcell__rrrNrrH<s	
+(

rHc@seZdZeZdS)�IntSubclassStrDigitLimitsTestsN)rrrrrTrrrrr��sr��__main__)r�rard�testr�test.test_grammarrrr�r�r�r�r�r�TestCaserrHr�r�mainrrrr�<module>sH�B�

Youez - 2016 - github.com/yon3zu
LinuXploit