ó
T:´Nc           @   s®   d  Z  d Z d d l Z d d l Z d d l Z e j d d k rc e j d d k rc d d l Tn  d d l Td e j f d	 „  ƒ  YZ	 d
 „  Z
 d „  Z d „  Z d „  Z d S(   s%   Common functions for SelfTest moduless   $Id$iÿÿÿÿNi    i   i   (   t   *t   _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   sE   t  |  t ƒ r( t d j |  j ƒ  ƒ ƒ St d ƒ j |  j ƒ  ƒ Sd S(   s,   Remove whitespace from a text or byte stringt    N(   t
   isinstancet   strt   bt   joint   split(   t   s(    (    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   5   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   9   s    (   t   __doc__t   __revision__t   unittestR   t   syst   version_infot   Crypto.Util.py21compatt   Crypto.Util.py3compatt
   TestLoaderR   R   R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/Crypto/SelfTest/st_common.pyt   <module>   s   &
			