ó
ē5CPc           @   sE   d  d l  Z  d  d l m Z d  d l Z d e  j f d     YZ d S(   i’’’’N(   t	   tempfilest   TestTempfilesc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   sØ   d } t  j   } |  j d |  t  j d d  } |  j d |  t  j d d d |  } |  j | |  t  j d d d |  } |  j d |  |  j | |  d  S(   Nt   dummystringt	   reportbugt   packaget   dpkgt    t   extra(   R    t   tempfile_prefixt   assertIn(   t   selfR   t   prefix(    (    s0   /home/morph/deb/reportbug/test/test_tempfiles.pyt   test_tempfile_prefix   s    c         C   sĀ   t  j j t  d } t j |  } |  j | j  | j   |  j	 | j  t j
 |  t  j j t  d } t j | d d } |  j | j  | j   |  j	 | j  t j
 |  d  S(   Ns   /tempfiletestt   modet   w(   t   ost   patht   dirnamet   __file__R    t   open_write_safet   assertFalset   closedt   closet
   assertTruet   cleanup_temp_file(   R
   t   filenamet   fd(    (    s0   /home/morph/deb/reportbug/test/test_tempfiles.pyt   test_open_write_safe   s    

c         C   sZ   t  j   \ } } |  j |  |  j | j  | j   |  j | j  t  j |  d  S(   N(   R    t   TempFilet   assertIsNotNoneR   R   R   R   R   (   R
   R   R   (    (    s0   /home/morph/deb/reportbug/test/test_tempfiles.pyt   test_TempFile0   s    
(   t   __name__t
   __module__R   R   R   (    (    (    s0   /home/morph/deb/reportbug/test/test_tempfiles.pyR      s   		(   t	   unittest2R   R    t   os.pathR   t   TestCaseR   (    (    (    s0   /home/morph/deb/reportbug/test/test_tempfiles.pyt   <module>   s   