ó
BwLc           @   sq   d  Z  d Z d d l Z d d l Z d d l Z d e j f d „  ƒ  YZ d „  Z d „  Z d „  Z	 d	 „  Z
 d S(
   s%   Common functions for SelfTest moduless   $Id$iÿÿÿÿNt   _list_testloaderc           B   s   e  Z e Z RS(    (   t   __name__t
   __module__t   listt
   suiteClass(    (    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyR    !   s   c         C   s   t  ƒ  j |  ƒ S(   s   Return a list of TestCase instances given a TestCase class

    This is useful when you have defined test* methods on your TestCase class.
    (   R    t   loadTestsFromTestCase(   t   class_(    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyt   list_test_cases$   s    c         C   sA   t  j t  j d t t  j ƒ ƒ } |  j | ƒ j d d ƒ }  |  S(   s   Remove whitespace from a stringt    t    (   t   stringt	   maketranst
   whitespacet   lent	   translatet   replace(   t   st   table(    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyt   strip_whitespace+   s    "c         C   s   t  j t |  ƒ ƒ S(   s2   Convert hexadecimal to binary, ignoring whitespace(   t   binasciit   a2b_hexR   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyR   1   s    c         C   s   t  j |  ƒ S(   s   Convert binary to hexadecimal(   R   t   b2a_hex(   R   (    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyR   5   s    (   t   __doc__t   __revision__t   unittestR
   R   t
   TestLoaderR    R   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyt   <module>   s   			