Sindbad~EG File Manager
�
'Μ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 �./usr/local/lib/python3.12/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<