3
¬ �e™  ã               @   sD   d Z ddlZddlZddlmZ dd„ Zdd„ Zdd	„ Zd
d„ ZdS )z%Common functions for SelfTest modulesé    N)Úbc             C   s   t jƒ j| ƒS )z�Return a list of TestCase instances given a TestCase class

    This is useful when you have defined test* methods on your TestCase class.
    )ÚunittestZ
TestLoaderZloadTestsFromTestCase)Úclass_© r   ú`/var/www/html/wholesaler-api-python-env/lib/python3.6/site-packages/Crypto/SelfTest/st_common.pyÚlist_test_cases    s    r   c             C   s2   t | tƒrtdj| jƒ ƒƒS tdƒj| jƒ ƒS dS )z,Remove whitespace from a text or byte stringÚ N)Ú
isinstanceÚstrr   ÚjoinÚsplit)Úsr   r   r   Ústrip_whitespace'   s    
r   c             C   s   t jt| ƒƒS )z2Convert hexadecimal to binary, ignoring whitespace)ÚbinasciiÚa2b_hexr   )r   r   r   r   r   .   s    r   c             C   s
   t j| ƒS )zConvert binary to hexadecimal)r   Úb2a_hex)r   r   r   r   r   2   s    r   )	Ú__doc__r   r   ZCrypto.Util.py3compatr   r   r   r   r   r   r   r   r   Ú<module>   s   