| Server IP : 121.121.20.254 / Your IP : 216.73.217.141 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/test/__pycache__/ |
Upload File : |
�
���g� � �� � d Z ddlZddlZddlZ G d� dej � Z G d� dej � Z G d� dej � Zed k( r ej � yy)
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 �( � e Zd ZdZd� Zd� Zd� Zd� Zy)�Compare_Digest_Testsz%Test secrets.compare_digest function.c � � dD ]t }|dz }|dz }| j t j ||� � | j t j |j d� |j d� � � �v y )N)�a�bcd�xyz123�d �utf-8)�
assertTrue�secrets�compare_digest�encode��self�sr �bs �&C:\Python312\\Lib\test\test_secrets.py�
test_equalzCompare_Digest_Tests.test_equal sb � �'�A��#��A��#��A��O�O�G�2�2�1�a�8�9��O�O�G�2�2�1�8�8�G�3D�a�h�h�w�FW�X�Y� (� c � � | j t j dd� � | j t j dd� � dD ]z }|dz dz }|dz dz }| j t j ||� � | j t j |j d � |j d � � � �| y )
N�abc�abcds abcs abcd)�x�mn�a1b2c3r �q�kr
)�assertFalser r
r r s r �test_unequalz!Compare_Digest_Tests.test_unequal s� � �����/�/��v�>�?�����/�/���@�A�&�A��#����A��#����A����W�3�3�A�q�9�:����W�3�3�A�H�H�W�4E�q�x�x�PW�GX�Y�Z� 'r c �
� d}|j d� }t |t � sJ �t |t � sJ �| j t
t j ||� | j t
t j ||� y )N�abcder
)r �
isinstance�str�bytes�assertRaises� TypeErrorr r
)r r r s r �test_bad_typesz#Compare_Digest_Tests.test_bad_types$ si � ���
�H�H�W����!�S�!�!�!��!�U�#�#�#����)�W�%;�%;�Q��B����)�W�%;�%;�Q��Br c � � | j t j dd� t � | j t j dd� t � y )Nr �xyz)�assertIsInstancer r
�bool)r s r � test_boolzCompare_Digest_Tests.test_bool- s<