ó
ŒwÛjc           @   s‘  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l m Z e j d d e d d d e ƒe e d ƒ r× d  d l Z d	 Z n d
 Z e  j e  j k Z e e d ƒ Z e j d4 k rd Z n d Z d e
 j f d „  ƒ  YZ g  Z d e f d „  ƒ  YZ e j e ƒ d e f d „  ƒ  YZ e j e ƒ d e f d „  ƒ  YZ  e j e  ƒ d e f d „  ƒ  YZ! e j e! ƒ d e f d „  ƒ  YZ" e j e" ƒ e	 j# d „  ƒ Z$ d „  Z% d d5 d „  ƒ  YZ& d  e& e f d! „  ƒ  YZ' e j e' ƒ d" e f d# „  ƒ  YZ( e j e( ƒ d$ e f d% „  ƒ  YZ) e j e) ƒ d& e f d' „  ƒ  YZ* e j e* ƒ d( e& e f d) „  ƒ  YZ+ e j e+ ƒ d* e f d+ „  ƒ  YZ, e j e, ƒ d, e f d- „  ƒ  YZ- e j e- ƒ d. e f d/ „  ƒ  YZ. e j e. ƒ d0 e f d1 „  ƒ  YZ/ e  j0 e  j1 k	 rne j e/ ƒ n  d2 „  Z2 e d3 k r�e2 ƒ  n  d S(6   iÿÿÿÿN(   t   test_supportt   ignoret   categoryt   messaget   mktempt   modulet   stati   i    t   spawnlt   openbsd3t   openbsd4i0   id   t   TCc           B   s,   e  Z e j d  ƒ Z d d „ Z d „  Z RS(   s   [a-zA-Z0-9_-]{6}$c         C   sA   | d  k r t j ƒ  } n  |  j d | | d | d f ƒ d  S(   Ns   %s raised %s: %si    i   (   t   Nonet   syst   exc_infot   fail(   t   selft   whatt   ei(    (    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_tempfile.pyt   failOnException-   s    c   	      C   sø   t  j j | ƒ \ } } | t | ƒ  } | t | ƒ t | ƒ } |  j t  j j | ƒ t  j j | ƒ d | | f ƒ |  j | | d | | f ƒ |  j | | d | | f ƒ | t | ƒ t | ƒ t | ƒ !} |  j |  j j | ƒ d | ƒ d  S(   Ns   file '%s' not in directory '%s's"   file '%s' does not begin with '%s's    file '%s' does not end with '%s's6   random string '%s' does not match /^[a-zA-Z0-9_-]{6}$/(	   t   ost   patht   splitt   lent   assertEqualt   abspatht
   assertTruet	   str_checkt   match(	   R   t   namet   dirt   pret   suft   ndirt   nbaset   npret   nsuf(    (    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_tempfile.pyt	   nameCheck2   s    $#N(   t   __name__t
   __module__t   ret   compileR   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_tempfile.pyR
   )   s   t   test_exportsc           B   s   e  Z d  „  Z RS(   c         C   sÃ   t  j } i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d	 6d d
 6d d 6d d 6} g  } x: | D]2 } | d d k ri | | k ri | j | ƒ qi qi W|  j t | ƒ d k d | ƒ d  S(   Ni   t   NamedTemporaryFilet   TemporaryFilet   mkstempt   mkdtempR   t   TMP_MAXt   gettempprefixt
   gettempdirt   tempdirt   templatet   SpooledTemporaryFilei    t   _s   unexpected keys: %s(   t   tempfilet   __dict__t   appendR   R   (   R   t   dictt   expectedt   unexpt   key(    (    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_tempfile.pyR)   G   s&    	
(   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_tempfile.pyR)   F   s   t   test__RandomNameSequencec           B   sV   e  Z d  Z d „  Z d „  Z d „  Z d „  Z e j e	 e
 d ƒ d ƒ d „  ƒ Z RS(   s6   Test the internal iterator object _RandomNameSequence.c         C   s   t  j ƒ  |  _ d  S(   N(   R5   t   _RandomNameSequencet   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_tempfile.pyt   setUpf   s    c         C   s)   |  j  j ƒ  } |  j | d d d ƒ d  S(   Nt    (   R>   t   nextR$   (   R   t   s(    (    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_tempfile.pyt   test_get_six_char_stri   s    c         C   sf   i  } |  j  } xP t t ƒ D]B } | j ƒ  } |  j | d d d ƒ |  j | | ƒ d | | <q Wd  S(   NR@   i   (   R>   t   xranget
   TEST_FILESRA   R$   t   assertNotIn(   R   R8   R>   t   iRB   (    (    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_tempfile.pyt	   test_manyn   s    	c         C   sY   d } |  j  } y/ x( | D]  } | d 7} | d k r Pq q WWn |  j d ƒ n Xd  S(   Ni    i   i   t	   iteration(   R>   R   (   R   RG   R>   RB   (    (    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_tempfile.pyt   test_supports_itery   s    	
t   forks!   os.fork is required for this testc         C   s   t  j ƒ  \ } } d  } z’ t  j ƒ  } | sy t  j | ƒ t  j | t |  j ƒ j d ƒ ƒ t  j | ƒ t  j	 d ƒ n  t |  j ƒ } t  j
 | t | ƒ ƒ j d ƒ } Wd  | rñ y t  j | t j ƒ Wn t k
 rÝ n Xt  j | d ƒ n  t  j | ƒ t  j | ƒ X|  j | | ƒ d  S(   Nt   asciii    (   R   t   pipeR   RK   t   closet   writeRA   R>   t   encodet   _exitt   readR   t   decodet   killt   signalt   SIGKILLt   EnvironmentErrort   waitpidt   assertNotEqual(   R   t   read_fdt   write_fdt   pidt   parent_valuet   child_value(    (    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_tempfile.pyt   test_process_awareness†   s(    "%(   R%   R&   t   __doc__R?   RC   RH   RJ   t   unittestt
   skipUnlesst   hasattrR   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_tempfile.pyR<   c   s   				t   test__candidate_tempdir_listc           B   s    e  Z d  Z d „  Z d „  Z RS(   s3   Test the internal function _candidate_tempdir_list.c         C   sJ   t  j ƒ  } |  j t | ƒ d k ƒ x | D] } |  j | t ƒ q, Wd  S(   Ni    (   R5   t   _candidate_tempdir_listt   assertFalseR   t   assertIsInstancet
   basestring(   R   t   candt   c(    (    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_tempfile.pyt   test_nonempty_list²   s    c      
   C   sé   t  j ƒ  �× } x< d D]4 } t j | ƒ } | s t j j | ƒ | | <q q Wt j ƒ  } x< d D]4 } t j | ƒ } | s… t ‚ n  |  j	 | | ƒ qa Wy t j
 ƒ  } Wn# t t j f k
 rÎ t j } n X|  j	 | | ƒ Wd  QXd  S(   Nt   TMPDIRt   TEMPt   TMP(   Rl   Rm   Rn   (   Rl   Rm   Rn   (   t   supportt   EnvironmentVarGuardR   t   getenvR   R   R5   Re   t
   ValueErrort   assertInt   getcwdt   AttributeErrort   errort   curdir(   R   t   envt   envnamet   dirnameRi   (    (    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_tempfile.pyt   test_wanted_dirs»   s      	(   R%   R&   R`   Rk   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_tempfile.pyRd   ¯   s   		t   TestGetDefaultTempdirc           B   s   e  Z d  Z d „  Z RS(   s   Test _get_default_tempdir().c            sp  t  j ƒ  ‰ zO‡ f d †  } t j t  d | ƒ �%t  j ƒ  |  j t j ˆ ƒ g  ƒ d „  ‰ t j t d ˆ ƒ �Y |  j	 t
 ƒ � } t  j ƒ  Wd  QX|  j | j j t j ƒ |  j t j ˆ ƒ g  ƒ Wd  QX‡  ‡ f d †  } t j t d | ƒ �[ ‰  |  j	 t
 ƒ � } t  j ƒ  Wd  QX|  j | j j t j ƒ |  j t j ˆ ƒ g  ƒ Wd  QXWd  QXWd  t j ˆ ƒ Xd  S(   Nc              s   ˆ  g S(   N(    (    (   t   our_temp_directory(    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_tempfile.pyt   our_candidate_listâ   s    Re   c          _   s   t  d ƒ ‚ d  S(   Niÿÿÿÿ(   t   OSError(   t   argst   kwargs(    (    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_tempfile.pyt   raise_OSErrorë   s    t   openc             s   ˆ  |  | Ž  } ˆ | _  | S(   N(   RO   (   R€   R�   t   fp(   t	   orig_openR‚   (    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_tempfile.pyt
   bad_writerõ   s    	(   R5   R-   Ro   t	   swap_attrt   _get_default_tempdirR   R   t   listdirt   iot   assertRaisest   IOErrort	   exceptiont   errnot   ENOENTt   shutilt   rmtree(   R   R~   t   cmR†   (    (   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_tempfile.pyt   test_no_files_left_behindÝ   s(    

	)(   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_tempfile.pyR|   Ú   s   t   test__get_candidate_namesc           B   s    e  Z d  Z d „  Z d „  Z RS(   s0   Test the internal function _get_candidate_names.c         C   s#   t  j ƒ  } |  j | t  j ƒ d  S(   N(   R5   t   _get_candidate_namesRg   R=   (   R   t   obj(    (    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_tempfile.pyt   test_retval	  s    c         C   s/   t  j ƒ  } t  j ƒ  } |  j | | k ƒ d  S(   N(   R5   R•   R   (   R   t   at   b(    (    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_tempfile.pyt   test_same_thing  s    (   R%   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_tempfile.pyR”     s   	c          c   sF   t  j ƒ  }  z% t j t  d |  ƒ �
 d  VWd  QXWd  t j |  ƒ Xd  S(   NR1   (   R5   R-   Ro   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_tempfile.pyt   _inside_empty_temp_dir  s
    c             s   t  j t d ‡  f d †  ƒ S(   NR•   c              s
   t  ˆ  ƒ S(   N(   t   iter(    (   t   names(    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_tempfile.pyt   <lambda>%  R@   (   Ro   R‡   R5   (   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_tempfile.pyt   _mock_candidate_names"  s    	t   TestBadTempdirc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c      
   C   sÿ   t  ƒ  �ð t j t j ƒ j } } | t j t j Bt j BM} t j	 t j | ƒ zŒ t j
 t j t j ƒ r} |  j d ƒ n  |  j t ƒ � } |  j ƒ  Wd  QX|  j | j j t j t j f ƒ |  j t j t j ƒ g  ƒ Wd  t j	 t j | ƒ XWd  QXd  S(   Ns!   can't set the directory read-only(   R›   R   R   R5   R1   t   st_modet   S_IWUSRt   S_IWGRPt   S_IWOTHt   chmodt   accesst   W_OKt   skipTestR‹   R   t	   make_tempRs   R�   RŽ   t   EPERMt   EACCESR   R‰   (   R   t   oldmodet   modeR’   (    (    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_tempfile.pyt   test_read_only_directory*  s    
" c         C   sƒ   t  ƒ  �t t j j t j d ƒ } t j t d | ƒ �@ |  j t	 ƒ � } |  j
 ƒ  Wd  QX|  j | j j t j ƒ Wd  QXWd  QXd  S(   Nt   nonexistentR1   (   R›   R   R   t   joinR5   R1   Ro   R‡   R‹   R   R©   R   R�   RŽ   R�   (   R   R1   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_tempfile.pyt   test_nonexisting_directory9  s    
c         C   sŸ   t  ƒ  �� t j j t j d ƒ } t | d ƒ j ƒ  t j	 t d | ƒ �I |  j
 t ƒ � } |  j ƒ  Wd  QX|  j | j j t j t j f ƒ Wd  QXWd  QXd  S(   Nt   filet   wbR1   (   R›   R   R   R°   R5   R1   Rƒ   RN   Ro   R‡   R‹   R   R©   Rs   R�   RŽ   t   ENOTDIRR�   (   R   R1   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_tempfile.pyt   test_non_directoryA  s    
(   R%   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_tempfile.pyR    (  s   		t   test__mkstemp_innerc           B   s½   e  Z d  Z d d d „  ƒ  YZ d d d d d „ Z d „  Z d „  Z d „  Z e	 j
 e d	 ƒ d
 „  ƒ Z e	 j
 e d ƒ d „  ƒ Z e	 j
 e d ƒ d „  ƒ Z d „  Z d „  Z d „  Z RS(   s*   Test the internal function _mkstemp_inner.t	   mkstempedc           B   sG   e  Z e j Z e j Z e j Z	 e j
 Z d  „  Z d „  Z d „  Z RS(   c         C   sC   | r |  j  } n	 |  j } t j | | | | ƒ \ |  _ |  _ d  S(   N(   t   _bflagst   _tflagsR5   t   _mkstemp_innert   fdR   (   R   R   R   R   t   bint   flags(    (    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_tempfile.pyt   __init__T  s     	c         C   s   t  j |  j | ƒ d  S(   N(   R   RO   R»   (   R   t   str(    (    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_tempfile.pyRO   Z  s    c         C   s$   |  j  |  j ƒ |  j |  j ƒ d  S(   N(   t   _closeR»   t   _unlinkR   (   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_tempfile.pyt   __del__]  s    (   R%   R&   R5   t   _bin_openflagsR¸   t   _text_openflagsR¹   R   RN   RÀ   t   unlinkRÁ   R¾   RO   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_tempfile.pyR·   N  s   						R@   i   c         C   sk   | d  k r t j ƒ  } n  y |  j | | | | ƒ } Wn |  j d ƒ n X|  j | j | | | ƒ | S(   NRº   (   R   R5   R0   R·   R   R$   R   (   R   R   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_tempfile.pyt	   do_createa  s    c         C   s‡   |  j  ƒ  j d ƒ |  j  d d ƒ j d ƒ |  j  d d ƒ j d ƒ |  j  d d d d ƒ j d ƒ |  j  d d d d ƒ j d ƒ d  S(   Nt   blatR   R˜   R   R™   t   aas   .txt(   RÆ   RO   (   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_tempfile.pyt
   test_basicl  s
    c         C   s7   t  t ƒ } x$ | D] } |  j d d ƒ | | <q Wd  S(   NR   RÈ   (   t   rangeRE   RÆ   (   R   t   extantRG   (    (    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_tempfile.pyt   test_basic_manyt  s    c         C   s>   t  j ƒ  } z |  j d | ƒ j d ƒ Wd  t j | ƒ Xd  S(   NR   RÇ   (   R5   R-   RÆ   RO   R   t   rmdir(   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_tempfile.pyt   test_choose_directoryz  s    s   os.stat not availablec         C   sj   |  j  ƒ  } t j t j | j ƒ j ƒ } d } t j d k rV | d ?} | d
 } n  |  j | | ƒ d  S(   Ni€  t   win32t   os2emxi   i   i   i@   (   RÏ   RÐ   i	   iI   (	   RÆ   R   t   S_IMODER   R   R¡   R   t   platformR   (   R   R²   R­   R9   t   user(    (    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_tempfile.pyt   test_file_mode‚  s    
s   os.spawnl not availablec         C   s  t  j r d } n d } |  j ƒ  } d | j } y
 t } Wn t k
 r[ t j d } n Xt j	 j
 t j	 j t j	 j | ƒ ƒ d ƒ } t j d
 k r² d t j } d | } n	 t j } t j t j t j | | | | ƒ } |  j | d k  d | ƒ |  j | d k d	 | ƒ d  S(   Nt   vt   qs   %di    s   tf_inherit_check.pyRÏ   s   "%s"s$   child process caught fatal signal %ds    child process reports failure %d(   RÏ   (   Ro   t   verboseRÆ   R»   t   __file__t	   NameErrorR   t   argvR   R   R°   Rz   R   RÒ   t
   executableR   t   P_WAITRf   (   R   RÕ   R²   R»   t   met   testert	   decoratedt   retval(    (    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_tempfile.pyt   test_noinherit�  s&    		
$		$s   text mode not availablec         C   s   |  j  d d ƒ j d ƒ d  S(   NR¼   i    s   blat
(   RÆ   RO   (   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_tempfile.pyt   test_textmodeµ  s    c         C   s"   t  j t  j ƒ  t  j d t  j ƒ S(   NR@   (   R5   Rº   R0   R2   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_tempfile.pyR©   ¼  s    c         C   s—   t  ƒ  �ˆ t d d d ƒ �o |  j ƒ  \ } } t j | ƒ |  j | j d ƒ ƒ |  j ƒ  \ } } t j | ƒ |  j | j d ƒ ƒ Wd  QXWd  QXd  S(   Nt   aaat   bbb(   R›   RŸ   R©   R   RN   R   t   endswith(   R   t   fd1t   name1t   fd2t   name2(    (    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_tempfile.pyt!   test_collision_with_existing_fileÂ  s    
c         C   s„   t  ƒ  �u t d d d ƒ �\ t j ƒ  } |  j | j d ƒ ƒ |  j ƒ  \ } } t j | ƒ |  j | j d ƒ ƒ Wd  QXWd  QXd  S(   NRã   Rä   (	   R›   RŸ   R5   R-   R   Rå   R©   R   RN   (   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_tempfile.pyt&   test_collision_with_existing_directoryÏ  s    
(    N(   R%   R&   R`   R·   R   RÆ   RÉ   RÌ   RÎ   Ra   Rb   t   has_statRÔ   t
   has_spawnlRá   t   has_textmodeRâ   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_tempfile.pyR¶   K  s   			%		t   test_gettempprefixc           B   s    e  Z d  Z d „  Z d „  Z RS(   s   Test gettempprefix().c         C   s9   t  j ƒ  } |  j | t ƒ |  j t | ƒ d k ƒ d  S(   Ni    (   R5   R/   Rg   Rh   R   R   (   R   t   p(    (    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_tempfile.pyt   test_sane_templateá  s    c         C   s¡   t  j ƒ  d } t  j d d ƒ } zj t j j | | ƒ } y  t j | t j t j Bƒ } Wn |  j	 d ƒ n Xt j
 | ƒ t j | ƒ Wd  t j | ƒ Xd  S(   Ns
   xxxxxx.xxxt   prefixR@   s   os.open(   R5   R/   R-   R   R   R°   Rƒ   t   O_RDWRt   O_CREATR   RN   RÅ   RÍ   (   R   Rð   t   dR»   (    (    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_tempfile.pyt   test_usable_templateè  s     (   R%   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_tempfile.pyRï   Þ  s   	t   test_gettempdirc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s   Test gettempdir().c         C   s_   t  j ƒ  } |  j t j j | ƒ p0 | t j k d | ƒ |  j t j j | ƒ d | ƒ d  S(   Ns   %s is not an absolute paths   %s is not a directory(   R5   R0   R   R   R   t   isabsRw   t   isdir(   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_tempfile.pyt   test_directory_exists  s
    $c         C   sL   y' t  j ƒ  } | j d ƒ | j ƒ  Wn |  j d t  j ƒ  ƒ n Xd  S(   NRÇ   s   create file in %s(   R5   R*   RO   RN   R   R0   (   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_tempfile.pyt   test_directory_writable
  s    c         C   s/   t  j ƒ  } t  j ƒ  } |  j | | k ƒ d  S(   N(   R5   R0   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_tempfile.pyRš     s    (   R%   R&   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_tempfile.pyR÷   þ  s   			t   test_mkstempc           B   s2   e  Z d  Z d d d d „ Z d „  Z d „  Z RS(   s   Test mkstemp().R@   c   	      C   sÝ   | d  k r t j ƒ  } n  yo t j d | d | d | ƒ \ } } t j j | ƒ \ } } t j j | ƒ } |  j | | d | | f ƒ Wn |  j	 d ƒ n Xz |  j
 | | | | ƒ Wd  t j | ƒ t j | ƒ Xd  S(   NR   Rò   t   suffixs+   Directory '%s' incorrectly returned as '%s'R,   (   R   R5   R0   R,   R   R   R   R   R   R   R$   RN   RÅ   (	   R   R   R   R   R»   R   R    R!   t   adir(    (    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_tempfile.pyRÆ   $  s    $c         C   sj   |  j  ƒ  |  j  d d ƒ |  j  d d ƒ |  j  d d d d ƒ |  j  d d d d ƒ |  j  d d ƒ d  S(	   NR   R˜   R   R™   RÈ   s   .txtR   t   .(   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_tempfile.pyRÉ   6  s    
c         C   s5   t  j ƒ  } z |  j d | ƒ Wd  t j | ƒ Xd  S(   NR   (   R5   R-   RÆ   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_tempfile.pyRÎ   ?  s    N(   R%   R&   R`   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_tempfile.pyRü   !  s   		t   test_mkdtempc           B   sq   e  Z d  Z d „  Z d d d d „ Z d „  Z d „  Z d „  Z e	 j
 e d ƒ d „  ƒ Z d	 „  Z d
 „  Z RS(   s   Test mkdtemp().c         C   s
   t  j ƒ  S(   N(   R5   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_tempfile.pyR©   M  s    R@   c         C   s�   | d  k r t j ƒ  } n  y" t j d | d | d | ƒ } Wn |  j d ƒ n Xy |  j | | | | ƒ | SWn t j | ƒ ‚  n Xd  S(   NR   Rò   Rý   R-   (   R   R5   R0   R-   R   R$   R   RÍ   (   R   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_tempfile.pyRÆ   P  s    "c         C   s‡   t  j |  j ƒ  ƒ t  j |  j d d ƒ ƒ t  j |  j d d ƒ ƒ t  j |  j d d d d ƒ ƒ t  j |  j d d d d ƒ ƒ d  S(   NR   R˜   R   R™   RÈ   s   .txt(   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_tempfile.pyRÉ   _  s
    c         C   so   t  t ƒ } z+ x$ | D] } |  j d d ƒ | | <q WWd  x- | D]% } t | t ƒ rA t j | ƒ qA qA WXd  S(   NR   RÈ   (   RÊ   RE   RÆ   t
   isinstanceRh   R   RÍ   (   R   RË   RG   (    (    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_tempfile.pyRÌ   g  s    c         C   s>   t  j ƒ  } z t j |  j d | ƒ ƒ Wd  t j | ƒ Xd  S(   NR   (   R5   R-   R   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_tempfile.pyRÎ   r  s    s   os.stat not availablec         C   s†   |  j  ƒ  } ze t j t j | ƒ j ƒ } | d M} d } t j d	 k r` | d ?} | d } n  |  j | | ƒ Wd  t j | ƒ Xd  S(   Niÿ  iÀ  RÏ   RÐ   i   i   i   i@   (   RÏ   RÐ   i	   iI   (	   RÆ   R   RÑ   R   R¡   R   RÒ   R   RÍ   (   R   R   R­   R9   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_tempfile.pyt	   test_modez  s    

c         C   s„   t  ƒ  �u t d d d ƒ �\ t j d t ƒ } | j ƒ  |  j | j j d ƒ ƒ t j	 ƒ  } |  j | j d ƒ ƒ Wd  QXWd  QXd  S(   NRã   Rä   t   delete(
   R›   RŸ   R5   R*   t   FalseRN   R   R   Rå   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_tempfile.pyRê   Œ  s    

c         C   sq   t  ƒ  �b t d d d ƒ �I t j ƒ  } |  j | j d ƒ ƒ t j ƒ  } |  j | j d ƒ ƒ Wd  QXWd  QXd  S(   NRã   Rä   (   R›   RŸ   R5   R-   R   Rå   (   R   t   dir1t   dir2(    (    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_tempfile.pyRë   —  s    
N(   R%   R&   R`   R©   R   RÆ   RÉ   RÌ   RÎ   Ra   Rb   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_tempfile.pyR   J  s   					t   test_mktempc           B   sT   e  Z d  Z d „  Z d „  Z d d	 d „  ƒ  YZ d d d „ Z d „  Z d „  Z RS(
   s   Test mktemp().c         C   s   t  j ƒ  |  _ d  S(   N(   R5   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_tempfile.pyR?   ©  s    c         C   s)   |  j  r% t j |  j  ƒ d  |  _  n  d  S(   N(   R   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_tempfile.pyt   tearDown¬  s    	t   mktempedc           B   s,   e  Z e j Z e j Z d  „  Z d „  Z	 RS(   c         C   sG   t  j d | d | d | ƒ |  _ t j t j |  j |  j d ƒ ƒ d  S(   NR   Rò   Rý   i€  (   R5   R   R   R   RN   Rƒ   R¸   (   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_tempfile.pyR¾   µ  s    !c         C   s   |  j  |  j ƒ d  S(   N(   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_tempfile.pyRÂ   »  s    (
   R%   R&   R   RÅ   RÁ   R5   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_tempfile.pyR	  ±  s   			R@   c         C   sS   y |  j  |  j | | ƒ } Wn |  j d ƒ n X|  j | j |  j | | ƒ | S(   NR   (   R	  R   R   R$   R   (   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_tempfile.pyRÆ   ¾  s    c         C   sZ   |  j  ƒ  |  j  d d ƒ |  j  d d ƒ |  j  d d d d ƒ |  j  d d d d ƒ d  S(   NR   R˜   R   R™   RÈ   s   .txt(   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_tempfile.pyRÉ   Ç  s
    
c         C   s7   t  t ƒ } x$ | D] } |  j d d ƒ | | <q Wd  S(   NR   RÈ   (   RÊ   RE   RÆ   (   R   RË   RG   (    (    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_tempfile.pyRH   Ï  s    (    (	   R%   R&   R`   R?   R  R	  RÆ   RÉ   RH   (    (    (    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_tempfile.pyR  ¤  s   				t   test_NamedTemporaryFilec           B   sk   e  Z d  Z d d d e d „ Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z RS(   s   Test NamedTemporaryFile().R@   c      	   C   sw   | d  k r t j ƒ  } n  y( t j d | d | d | d | ƒ } Wn |  j d ƒ n X|  j | j | | | ƒ | S(   NR   Rò   Rý   R  R*   (   R   R5   R0   R*   R   R$   R   (   R   R   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_tempfile.pyRÆ   æ  s    c         C   sZ   |  j  ƒ  |  j  d d ƒ |  j  d d ƒ |  j  d d d d ƒ |  j  d d d d ƒ d  S(   NR   R˜   R   R™   RÈ   s   .txt(   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_tempfile.pyRÉ   ó  s
    
c         C   s6   t  j ƒ  } |  j t j j | j ƒ d | j ƒ d  S(   Ns$   NamedTemporaryFile %s does not exist(   R5   R*   R   R   R   t   existsR   (   R   t   f(    (    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_tempfile.pyt   test_creates_namedû  s    c         C   st   t  j ƒ  } zS t  j d | ƒ } | j d ƒ | j ƒ  |  j t j j | j	 ƒ d | j	 ƒ Wd  t j
 | ƒ Xd  S(   NR   RÇ   s(   NamedTemporaryFile %s exists after close(   R5   R-   R*   RO   RN   Rf   R   R   R  R   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_tempfile.pyt   test_del_on_close  s    
c         C   s¥   t  j ƒ  } d  } zb t  j d | d t ƒ } | j } | j d ƒ | j ƒ  |  j t	 j
 j | j ƒ d | j ƒ Wd  | d  k	 r“ t	 j | ƒ n  t	 j | ƒ Xd  S(   NR   R  RÇ   s)   NamedTemporaryFile %s missing after close(   R5   R-   R   R*   R  R   RO   RN   R   R   R   R  RÅ   RÍ   (   R   R   t   tmpR  (    (    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_tempfile.pyt   test_dis_del_on_close  s    	
c         C   sV   t  j ƒ  } | j d ƒ | j ƒ  y | j ƒ  | j ƒ  Wn |  j d ƒ n Xd  S(   Ns   abc
RN   (   R5   R*   RO   RN   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_tempfile.pyt   test_multiple_close  s    

c            sp   t  j ƒ  �# ‰  |  j t j j ˆ  j ƒ ƒ Wd  QX|  j t j j ˆ  j ƒ ƒ ‡  f d †  } |  j t	 | ƒ d  S(   Nc              s   ˆ  � Wd  QXd  S(   N(    (    (   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_tempfile.pyt
   use_closed-  s    (
   R5   R*   R   R   R   R  R   Rf   R‹   Rr   (   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_tempfile.pyt   test_context_manager(  s
    "c            sŒ   t  j ‰ t  j } g  ‰  ‡  ‡ f d †  } d „  } | t  _ | t  _ z- |  j t t j ƒ |  j t ˆ  ƒ d ƒ Wd  ˆ t  _ | t  _ Xd  S(   Nc            s   ˆ |  ƒ ˆ  j  |  ƒ d  S(   N(   R7   (   R»   (   t   closedt	   old_close(    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_tempfile.pyRN   7  s    
c          W   s   t  ƒ  ‚ d  S(   N(   Rr   (   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_tempfile.pyt   fdopen:  s    i   (	   R   RN   R  R‹   Rr   R5   R*   R   R   (   R   t
   old_fdopenRN   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_tempfile.pyt   test_no_leak_fd2  s    						c      	   C   sh   t  j ƒ  } |  j t j | ƒ |  j t ƒ � t  j d d d | ƒ Wd  QX|  j t	 j
 | ƒ g  ƒ d  S(   NR­   R   (    (   R5   R-   t
   addCleanupRo   R‘   R‹   t	   TypeErrorR*   R   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_tempfile.pyt   test_bad_modeE  s
    N(   R%   R&   R`   R   t   TrueRÆ   RÉ   R  R  R  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_tempfile.pyR
  ã  s   						
	t   test_SpooledTemporaryFilec           B   s³   e  Z d  Z d d d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Test SpooledTemporaryFile().i    R@   c      	   C   s^   | d  k r t j ƒ  } n  y( t j d | d | d | d | ƒ } Wn |  j d ƒ n X| S(   Nt   max_sizeR   Rò   Rý   R3   (   R   R5   R0   R3   R   (   R   R  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_tempfile.pyRÆ   S  s    (c         C   sN   |  j  ƒ  } |  j | j ƒ |  j  d d d d d d ƒ } |  j | j ƒ d  S(   NR  id   R   R˜   R   s   .txt(   RÆ   Rf   t   _rolled(   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_tempfile.pyRÉ   ^  s    c         C   s¡   t  j ƒ  } z€ t  j d d d | ƒ } |  j | j ƒ | j d d ƒ |  j | j ƒ | j } | j ƒ  |  j t	 j
 j | ƒ d | ƒ Wd  t	 j | ƒ Xd  S(   NR  i
   R   s   blat i   s*   SpooledTemporaryFile %s exists after close(   R5   R-   R3   Rf   R  RO   R   R   RN   R   R   R  RÍ   (   R   R   R  t   filename(    (    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_tempfile.pyR  e  s    	
c         C   sj   |  j  d d ƒ } |  j | j ƒ x1 t d ƒ D]# } | j d d ƒ | j d ƒ q/ W|  j | j ƒ d  S(   NR  i   i   i    t   xi   t   xxxxxxxxxxxxxxxxxxxx(   RÆ   Rf   R  RÊ   t   seekRO   (   R   R  RG   (    (    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_tempfile.pyt   test_rewrite_smallt  s    c         C   s}   |  j  d d ƒ } |  j | j ƒ | j d ƒ |  j | j ƒ | j d ƒ |  j | j ƒ | j d ƒ |  j | j ƒ d  S(   NR  i   R!  i   i
   R"  t
   xxxxxxxxxx(   RÆ   Rf   R  RO   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_tempfile.pyt   test_write_sequential}  s    c         C   sF   |  j  ƒ  } | j d ƒ | j d ƒ | j ƒ  } |  j | d ƒ d  S(   NR!  t   yt   zi    t   xyz(   R!  R'  R(  (   RÆ   t
   writelinesR#  RR   R   (   R   R  t   buf(    (    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_tempfile.pyt   test_writelines‰  s
    c         C   sY   |  j  d d ƒ } | j d d d	 f ƒ |  j | j ƒ | j d ƒ |  j | j ƒ d  S(
   NR  i#   R!  i   i
   i   R"  R%  t   xxxxx(   RÆ   R*  Rf   R  RO   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_tempfile.pyt   test_writelines_sequential‘  s
    c         C   sº   |  j  d d ƒ } | j d	 ƒ | j d ƒ |  j | j ƒ |  j t | j ƒ  ƒ d g d ƒ | j d ƒ |  j | j ƒ | j d ƒ |  j t | j ƒ  ƒ d g d d d g ƒ d  S(
   NR  i   s   abc
i   i    s   x
ys   x
R'  s   abc
abc
abc
abc
abc
(	   RÆ   RO   R#  Rf   R  R   t   listt
   xreadlinesR   (   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_tempfile.pyt   test_xreadlinesš  s    #c         C   sc   |  j  d d ƒ } |  j | j ƒ | j d d ƒ |  j | j ƒ | j d ƒ |  j | j ƒ d  S(   NR  i   id   i    R!  (   RÆ   Rf   R  R#  RO   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_tempfile.pyt   test_sparse¥  s    c         C   sO   |  j  d d ƒ } |  j | j ƒ |  j | j ƒ  d k ƒ |  j | j ƒ d  S(   NR  i   i    (   RÆ   Rf   R  R   t   fileno(   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_tempfile.pyt   test_fileno¯  s    c         C   sf   t  j ƒ  } | j d ƒ |  j | j ƒ | j ƒ  y | j ƒ  | j ƒ  Wn |  j d ƒ n Xd  S(   Ns   abc
RN   (   R5   R3   RO   Rf   R  RN   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_tempfile.pyt#   test_multiple_close_before_rollover¶  s    

c         C   sl   t  j d d ƒ } | j d ƒ |  j | j ƒ | j ƒ  y | j ƒ  | j ƒ  Wn |  j d ƒ n Xd  S(   NR  i   s   abc
RN   (   R5   R3   RO   R   R  RN   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_tempfile.pyt"   test_multiple_close_after_rolloverÂ  s    

c         C   s   |  j  d d ƒ } | j } | j } | j } | d d ƒ | d d ƒ | d d ƒ |  j | d ƒ d d d d k ƒ d  S(   NR  i   R˜   i#   R™   i    iF   (   RÆ   RR   RO   R#  R   (   R   R  RR   RO   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_tempfile.pyt   test_bound_methodsÎ  s    			c         C   s
  t  j d d ƒ } | j d ƒ |  j | j ƒ |  j | j d ƒ |  j | j ƒ |  j	 t
 ƒ � | j Wd  QX|  j	 t
 ƒ � | j Wd  QX| j d ƒ |  j | j ƒ |  j | j d ƒ |  j | j ƒ |  j	 t
 ƒ � | j Wd  QX|  j	 t
 ƒ � | j Wd  QXd  S(   NR  i
   R!  s   w+bR%  (   R5   R3   RO   Rf   R  R   R­   t   assertIsNoneR   R‹   Ru   t   newlinest   encodingR   t   assertIsNotNone(   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_tempfile.pyt   test_propertiesÜ  s"    c            sn   t  j d d ƒ �' ‰  |  j ˆ  j ƒ |  j ˆ  j ƒ Wd  QX|  j ˆ  j ƒ ‡  f d †  } |  j t | ƒ d  S(   NR  i   c              s   ˆ  � Wd  QXd  S(   N(    (    (   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_tempfile.pyR  ö  s    (   R5   R3   Rf   R  R  R   R‹   Rr   (   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_tempfile.pyt$   test_context_manager_before_rolloverð  s    c            s•   t  j d d ƒ �N ‰  |  j ˆ  j ƒ ˆ  j d ƒ ˆ  j ƒ  |  j ˆ  j ƒ |  j ˆ  j ƒ Wd  QX|  j ˆ  j ƒ ‡  f d †  } |  j t	 | ƒ d  S(   NR  i   s   abc
c              s   ˆ  � Wd  QXd  S(   N(    (    (   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_tempfile.pyR    s    (
   R5   R3   Rf   R  RO   t   flushR   R  R‹   Rr   (   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_tempfile.pyt$   test_context_manager_during_rolloverû  s    
c            s‰   t  j d d ƒ ‰  ˆ  j d ƒ ˆ  j ƒ  |  j ˆ  j ƒ ˆ  � |  j ˆ  j ƒ Wd  QX|  j ˆ  j ƒ ‡  f d †  } |  j t	 | ƒ d  S(   NR  i   s   abc
c              s   ˆ  � Wd  QXd  S(   N(    (    (   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_tempfile.pyR    s    (
   R5   R3   RO   R>  R   R  Rf   R  R‹   Rr   (   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_tempfile.pyt#   test_context_manager_after_rollover	  s    
N(   R%   R&   R`   R   RÆ   RÉ   R  R$  R&  R,  R.  R1  R2  R4  R5  R6  R7  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_tempfile.pyR  P  s$   										
							t   test_TemporaryFilec           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s   Test TemporaryFile().c         C   s)   y t  j ƒ  Wn |  j d ƒ n Xd  S(   NR+   (   R5   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_tempfile.pyRÉ     s    c         C   s}   t  j ƒ  } t  j d | ƒ } | j d ƒ y t j | ƒ Wn: t j ƒ  } | j ƒ  t j | ƒ |  j	 d | ƒ n Xd  S(   NR   RÇ   RÍ   (
   R5   R-   R+   RO   R   RÍ   R   R   RN   R   (   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_tempfile.pyt   test_has_no_name&  s    
c         C   sV   t  j ƒ  } | j d ƒ | j ƒ  y | j ƒ  | j ƒ  Wn |  j d ƒ n Xd  S(   Ns   abc
RN   (   R5   R+   RO   RN   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_tempfile.pyR  7  s    

(   R%   R&   R`   RÉ   RB  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_tempfile.pyRA    s   		c           C   s   t  j t Œ  d  S(   N(   Ro   t   run_unittestt   test_classes(    (    (    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_tempfile.pyt	   test_mainH  s    t   __main__(   R   R	   (    (3   R5   RŽ   RŠ   R   RU   R�   R   R'   t   warningst
   contextlibRa   t   testR    Ro   t   filterwarningst   RuntimeWarningR%   Rc   R   Rì   RÄ   RÃ   Rî   Rí   RÒ   RE   t   TestCaseR
   RD  R)   R7   R<   Rd   R|   R”   t   contextmanagerR›   RŸ   R    R¶   Rï   R÷   Rü   R   R  R
  R  RA  R*   R+   RE  (    (    (    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_tempfile.pyt   <module>   sx   		I')
	#� &W9kÈ*	