ó
wŰjc           @   sv   d  Z  d d l Z d d l Z d d l Z d d l m Z d e j f d     YZ d   Z e	 d k rr 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.
i˙˙˙˙N(   t   test_supportt   BinHexTestCasec           B   s)   e  Z d    Z d   Z d Z d   Z RS(   c         C   s$   t  j d |  _ t  j d |  _ d  S(   Nt   1t   2(   R    t   TESTFNt   fname1t   fname2(   t   self(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_binhex.pyt   setUp   s    c         C   sT   y t  j |  j  Wn t k
 r' n Xy t  j |  j  Wn t k
 rO n Xd  S(   N(   t   ost   unlinkR   t   OSErrorR   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_binhex.pyt   tearDown   s        s   Jack is my heroc         C   s   t  |  j d  } | j |  j  | j   t j |  j |  j  t j |  j |  j  t  |  j d  } | j   } | j   |  j	 |  j |  d  S(   Nt   wt   r(
   t   openR   t   writet   DATAt   closet   binhexR   t   hexbint   readlinet   assertEqual(   R   t   ft   finish(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_binhex.pyt   test_binhex   s    

(   t   __name__t
   __module__R   R   R   R   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_binhex.pyR      s   		c           C   s   t  j t  d  S(   N(   R    t   run_unittestR   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_binhex.pyt	   test_main+   s    t   __main__(
   t   __doc__R   R	   t   unittestt   testR    t   TestCaseR   R   R   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_binhex.pyt   <module>   s   	