403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
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__/test_secrets.cpython-36.pyc
3

�w2_�@sfdZddlZddlZddlZGdd�dej�ZGdd�dej�ZGdd�dej�Zed	krbej	�dS)
z�Test the secrets module.

As most of the functions in secrets are thin wrappers around functions
defined elsewhere, we don't need to test them exhaustively.
�Nc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Compare_Digest_Testsz%Test secrets.compare_digest function.cCsRxLdD]D}|d}|d}|jtj||��|jtj|jd�|jd���qWdS)N�a�bcd�xyz123�dzutf-8)rrr)�
assertTrue�secrets�compare_digest�encode)�self�sr�b�r�6/opt/alt/python36/lib64/python3.6/test/test_secrets.py�
test_equals

zCompare_Digest_Tests.test_equalcCs~|jtjdd��|jtjdd��xTdD]L}|dd	}|dd
}|jtj||��|jtj|jd�|jd���q*WdS)
N�abcZabcdsabcsabcd�x�mn�a1b2c3r�q�kzutf-8)rrr)ZassertFalserr	r
)rrrr
rrr�test_unequals
z!Compare_Digest_Tests.test_unequalcCsRd}|jd�}t|t�st�t|t�s*t�|jttj||�|jttj||�dS)NZabcdezutf-8)	r
�
isinstance�str�AssertionError�bytes�assertRaises�	TypeErrorrr	)rrr
rrr�test_bad_types$s
z#Compare_Digest_Tests.test_bad_typescCs,|jtjdd�t�|jtjdd�t�dS)NrZxyz)�assertIsInstancerr	�bool)rrrr�	test_bool-szCompare_Digest_Tests.test_boolN)�__name__�
__module__�__qualname__�__doc__rrrr!rrrrrs

	rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Random_Testsz*Test wrappers around SystemRandom methods.cCs^d}xTdD]L}xFtd�D]:}tj|�}|jd|ko@d|kn|||f�qWq
WdS)	Nzrandbits(%d) returned %d����r�)r'r(r))�rangerZrandbitsr)r�errmsgZnumbits�i�nrrr�
test_randbits6s


zRandom_Tests.test_randbitscCs<dddddddg}x$td�D]}|jtj|�|k�qWdS)	N�r+���� �@�
)r,rrZchoice)r�itemsr.rrr�test_choice>szRandom_Tests.test_choicecCsNx(tdd�D]}|jtj|�t|��qW|jttjd�|jttjd�dS)Nr+r7rr1���)r,ZassertInrZ	randbelowr�
ValueError)rr.rrr�test_randbelowDszRandom_Tests.test_randbelowN)r"r#r$r%r0r9r<rrrrr&3sr&c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Token_TestszTest token functions.cCs�x�tjtjtjfD]�}|j|d��j|j}y
|�Wn"tk
rV|jd|�YnXy|d�Wn"tk
r�|jd|�YnXWdQRXqWtj}|j	t
tjd��|�|j	t
tjd��d|�dS)N)�funcz$%s cannot be called with no argumentz%s cannot be called with Noner+)r�token_bytes�	token_hex�
token_urlsafe�subTestr"rZfailZDEFAULT_ENTROPY�assertEqual�len)rr>�name�sizerrr�test_token_defaultsOs

"zToken_Tests.test_token_defaultscCsRxLdD]D}|j|d��.|jtj|�t�|jttj|��|�WdQRXqWdS)Nr1r3�r)r/)r1r3rHr)rBrrr?rrCrD)rr/rrr�test_token_bytesas
zToken_Tests.test_token_bytescCslxfd	D]^}|j|d��Htj|�}|j|t�|jt|�d|�|jtdd�|D���WdQRXqWdS)
Nr1r(��Z)r/r+css|]}|tjkVqdS)N)�stringZ	hexdigits)�.0�crrr�	<genexpr>osz-Token_Tests.test_token_hex.<locals>.<genexpr>)r1r(rJrK)	rBrr@rrrCrDr�all)rr/rrrr�test_token_hexhs

zToken_Tests.test_token_hexc
sltjtjd�xVd	D]N}|j|d��8tj|�}|j|t�|jt	�fdd�|D���WdQRXqWdS)
Nz-_r1���L)r/c3s|]}|�kVqdS)Nr)rMrN)�legalrrrOxsz1Token_Tests.test_token_urlsafe.<locals>.<genexpr>)r1rRrSrT)
rLZ
ascii_lettersZdigitsrBrrArrrrP)rr/rr)rUr�test_token_urlsafeqs

zToken_Tests.test_token_urlsafeN)r"r#r$r%rGrIrQrVrrrrr=Ls
	r=�__main__)
r%rZunittestrLZTestCaserr&r=r"�mainrrrr�<module>s$/

Youez - 2016 - github.com/yon3zu
LinuXploit