
    ,h                         d Z ddlZddlZddlmZ ddlmZ  G d de      ZddZ	i fdZ
ed	k(  rd
 Z ej                  d       yy)zgSelf tests

These tests should perform quickly and can ideally be used every time an
application runs.
    N)import_module)StringIOc                       e Zd Zd Zy)SelfTestErrorc                 N    t         j                  | ||       || _        || _        y N)	Exception__init__messageresult)selfr   r   s      Z/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/Crypto/SelfTest/__init__.pyr
   zSelfTestError.__init__&   s"    4&1    N)__name__
__module____qualname__r
    r   r   r   r   %   s    r   r   c                    |i }t        j                         }|  |t        |      }|j                  |       n/|"|j                  | j                  |             nt	        d      |t               |d<   n||d<   t        j                  dd|i|}|j                  |      }|j                         s>|0t        j                  j                  |d   j                                t        d|      |S )a6  Execute self-tests.

    This raises SelfTestError if any test is unsuccessful.

    You may optionally pass in a sub-module of SelfTest if you only want to
    perform some of the tests.  For example, the following would test only the
    hash modules:

        Crypto.SelfTest.run(Crypto.SelfTest.Hash)

    configz5'module' and 'tests' arguments are mutually exclusivestream	verbosityzSelf-test failedr   )unittest	TestSuite	get_testsaddTests
ValueErrorr   TextTestRunnerrunwasSuccessfulsysstderrwritegetvaluer   )	moduler   r   testsr   kwargssuiterunnerr   s	            r   r   r   ,   s     ~ E~=V,Eu=NN6++6+:;TUU~#:x!x$$CyCFCFZZF!>JJVH-6689.77Mr   c                 f    g }g d}|D ]%  }t        d|z         }||j                  |       z  }' |S )N)	CipherHashProtocol	PublicKeyRandomUtil	SignatureIOMathzCrypto.SelfTest.r   )r   r   )r   r&   module_namesnamer%   s        r   r   r   R   sN    E
L
  11D89!!!001 Lr   __main__c                  <    t        j                  t                     S r   )r   r   r   r   r   r   r(   r(   b   s    !!)+..r   r(   )defaultTest)Nr   NNN)__doc__r!   r   	importlibr   Crypto.Util.py3compatr   r	   r   r   r   r   r(   mainr   r   r   <module>r=      sV   2   # *I #L   z/HMMg& r   