mς
­fIc           @   sl   d  Z  d k Z d k Z d k Z d k l Z d e i f d     YZ d   Z e	 d j o e   n d S(   s   Test script for the binhex C module

   Uses the mechanism of the python binhex module
   Based on an original test by Roger E. Masse.
N(   s   test_supportt   BinHexTestCasec           B   s)   t  Z d   Z d   Z d Z d   Z RS(   Nc         C   s$   t  i d |  _ t  i d |  _ d  S(   Nt   1t   2(   t   test_supportt   TESTFNt   selft   fname1t   fname2(   R   (    (    t-   /mit/python/lib/python2.4/test/test_binhex.pyt   setUp   s    c         C   sX   y t  i |  i  Wn t j
 o n Xy t  i |  i  Wn t j
 o n Xd  S(   N(   t   ost   unlinkR   R   t   OSErrorR   (   R   (    (    R   t   tearDown   s        s   Jack is my heroc         C   s   t  |  i d  } | i |  i  | i   t i |  i |  i  t i	 |  i |  i  t  |  i d  } | i
   } | i   |  i |  i |  d  S(   Nt   wt   r(   t   openR   R   t   ft   writet   DATAt   closet   binhexR   t   hexbint   readlinet   finisht   assertEqual(   R   R   R   (    (    R   t   test_binhex   s    

(   t   __name__t
   __module__R	   R   R   R   (    (    (    R   R       s   		c           C   s   t  i t  d  S(   N(   R   t   run_unittestR    (    (    (    R   t	   test_main,   s    t   __main__(
   t   __doc__R   R
   t   unittestt   testR   t   TestCaseR    R   R   (   R   R!   R   R    R   R
   (    (    R   t   ?   s   				