U
    g                     @   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  | S )zReturn 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   A/tmp/pip-unpacked-wheel-_q8s9isk/Cryptodome/SelfTest/st_common.pylist_test_cases    s    r   c                 C   s2   t | trtd|  S td|  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 t| S )z2Convert hexadecimal to binary, ignoring whitespace)binasciia2b_hexr   r   r   r   r   r   .   s    r   c                 C   s
   t | S )zConvert binary to hexadecimal)r   b2a_hexr   r   r   r   r   2   s    r   )	__doc__r   r   ZCryptodome.Util.py3compatr   r   r   r   r   r   r   r   r   <module>   s   