ó
‹wÛjc           @   s¡   d  Z  d d l Z d d l m Z d d l Z d d l Z d d l Z d „  Z d e j f d „  ƒ  YZ	 d e	 f d „  ƒ  YZ
 d	 „  Z e d
 k r� e ƒ  n  d S(   s<   
Tests common to genericpath, macpath, ntpath and posixpath
iÿÿÿÿN(   t   test_supportc         C   s)   y t  j |  ƒ Wn t k
 r$ n Xd  S(   N(   t   ost   rmdirt   OSError(   t   dirname(    (    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_genericpath.pyt
   safe_rmdir   s    t   GenericTestc           B   sq   e  Z e Z d  d d d d d d d g Z g  Z d „  Z d	 „  Z d
 „  Z d „  Z	 d „  Z
 d „  Z d „  Z RS(   t   commonprefixt   getsizet   getatimet   getctimet   getmtimet   existst   isdirt   isfilec      	   C   si   xb |  j  |  j D]P } |  j t ƒ �9 t |  j | ƒ ƒ  |  j d j |  j j | ƒ ƒ ‚ Wd  QXq Wd  S(   Ns!   {}.{}() did not raise a TypeError(	   t   common_attributest
   attributest   assertRaisest	   TypeErrort   getattrt
   pathmodulet   failt   formatt   __name__(   t   selft   attr(    (    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_genericpath.pyt   test_no_argument   s
    c         C   s–  |  j  j } |  j | g  ƒ d ƒ |  j | d d g ƒ d ƒ |  j | d d g ƒ d ƒ |  j | d d g ƒ d ƒ |  j | d d g ƒ d	 ƒ |  j | d
 d g ƒ d ƒ |  j | d
 d
 g ƒ d
 ƒ d d d d d d d d d d d g } xž | D]– } x� | D]… } | | | g ƒ } |  j | j | ƒ ƒ |  j | j | ƒ ƒ | | k rt | ƒ } |  j | | | d !| | | d !ƒ qqWqø Wd  S(   Nt    s   /home/swenson/spams   /home/swen/spams
   /home/swens   /home/swen/eggss   /home/swen/s   home:swenson:spams   home:swen:spams	   home:swens   :home:swen:spams   :home:swen:eggss   :home:swen:t   abct   Xbcdt   Xbt   XYt   abcdt   aXct   abdt   abt   aXt   abcXi   (   R   R   t   assertEqualt
   assertTruet
   startswitht   lent   assertNotEqual(   R   R   t   testlistt   s1t   s2t   pt   n(    (    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_genericpath.pyt   test_commonprefix!   s@    	c         C   sz   t  t j d ƒ } z: | j d ƒ | j ƒ  |  j |  j j t j ƒ d ƒ Wd  | j se | j ƒ  n  t j	 t j ƒ Xd  S(   Nt   wbt   fooi   (
   t   openR    t   TESTFNt   writet   closeR&   R   R   t   closedt   unlink(   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_genericpath.pyt   test_getsizeK   s    
#	c         C   sê   t  t j d ƒ } zª | j d ƒ | j ƒ  t  t j d ƒ } | j d ƒ | j ƒ  t  t j d ƒ } | j ƒ  } | j ƒ  |  j | d ƒ |  j |  j j	 t j ƒ |  j j
 t j ƒ ƒ Wd  | j sÕ | j ƒ  n  t j t j ƒ Xd  S(   NR1   R2   R#   t   bart   rbt   foobar(   R3   R    R4   R5   R6   t   readR&   t   assertLessEqualR   R
   R   R7   R8   (   R   R9   t   d(    (    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_genericpath.pyt	   test_timeV   s"    


	c         C   sÍ   |  j  |  j j t j ƒ t ƒ t t j d ƒ } zk | j d ƒ | j ƒ  |  j  |  j j t j ƒ t	 ƒ |  j t
 k s› |  j  |  j j t j ƒ t	 ƒ n  Wd  | j ƒ  s¸ | j ƒ  n  t j t j ƒ Xd  S(   NR1   R2   (   t   assertIsR   R   R    R4   t   FalseR3   R5   R6   t   Truet   genericpatht   lexistsR8   (   R   R9   (    (    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_genericpath.pyt   test_existsl   s    
c         C   sø   |  j  |  j j t j ƒ t ƒ t t j d ƒ } z‰ | j d ƒ | j ƒ  |  j  |  j j t j ƒ t ƒ t	 j
 t j ƒ t	 j t j ƒ |  j  |  j j t j ƒ t ƒ t	 j t j ƒ Wd  | j ƒ  sÖ | j ƒ  n  t j t j ƒ t t j ƒ Xd  S(   NR1   R2   (   RB   R   R   R    R4   RC   R3   R5   R6   R   t   removet   mkdirRD   R   R8   R   (   R   R9   (    (    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_genericpath.pyt
   test_isdir{   s    
c         C   sø   |  j  |  j j t j ƒ t ƒ t t j d ƒ } z‰ | j d ƒ | j ƒ  |  j  |  j j t j ƒ t	 ƒ t
 j t j ƒ t
 j t j ƒ |  j  |  j j t j ƒ t ƒ t
 j t j ƒ Wd  | j ƒ  sÖ | j ƒ  n  t j t j ƒ t t j ƒ Xd  S(   NR1   R2   (   RB   R   R   R    R4   RC   R3   R5   R6   RD   R   RH   RI   R   R8   R   (   R   R9   (    (    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_genericpath.pyt   test_isfileŒ   s    
(   R   t
   __module__RE   R   R   R   R   R0   R:   RA   RG   RJ   RK   (    (    (    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_genericpath.pyR      s   		*				t
   CommonTestc           B   sù   e  Z d$ Z e j d  d d d d d d d d d	 d
 d d d d d d d d d d d d d d g Z d „  Z d „  Z d „  Z e	 j
 e j d ƒ d „  ƒ Z d „  Z d „  Z e j d „  ƒ Z e j d  „  ƒ Z e	 j e j d! k d" ƒ d# „  ƒ Z RS(%   t   curdirt   pardirt   extsept   sept   pathsept   defpatht   altsept   devnullt   normcaset
   splitdrivet
   expandvarst   normpatht   abspatht   joint   splitt   splitextt   isabst   basenameR   RF   t   islinkt   ismountt
   expandusert   realpathc         C   s8   d } |  j  j | ƒ } |  j | |  j  j | ƒ ƒ d  S(   Ns	   FoO/./BaR(   R   RV   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_genericpath.pyt   test_normcase®   s    c         C   sR   |  j  j } |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ d  S(   Ns   /foo/barR   s   foo:bars   :foo:bar(   R   s   /foo/bar(   R   s   foo:bar(   R   s   :foo:bar(   R   RW   R&   (   R   RW   (    (    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_genericpath.pyt   test_splitdrive´   s    c         C   sa  |  j  j d k r" |  j d ƒ n  |  j  j } t j ƒ  �!} | j ƒ  d | d <d | d <d | d <|  j | d ƒ d ƒ |  j | d	 ƒ d
 ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ |  j | d ƒ d ƒ Wd  QXd  S(   Nt   macpaths   macpath.expandvars is a stubR;   R2   t   baz1s   {foot   baz2s   {foo}s   $foo bars   bar bars	   ${foo}bart   barbars	   $[foo]bars   $bar bars   $?bars   $foo}bars   bar}bars   ${foos   ${{foo}}s   baz1}s   $foo$foos   $bar$bar(   R   R   t   skipTestRX   R    t   EnvironmentVarGuardt   clearR&   (   R   RX   t   env(    (    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_genericpath.pyt   test_expandvars»   s&    



s   need test_support.FS_NONASCIIc            ss  ˆ j  j d k r" ˆ j d ƒ n  ˆ j  j ‰  ‡  ‡ f d †  } t j ƒ  } t j ƒ  �} | j ƒ  t j	 } | j
 | ƒ } | | d <d | | | <| | | ƒ | d d | ƒ | d d	 | ƒ | d
 | d | ƒ | d | d | ƒ | d d | ƒ | | | ƒ | d d | ƒ | d d | ƒ | d | d | ƒ | d | d | ƒ | d d | ƒ Wd  QXd  S(   NRf   s   macpath.expandvars is a stubc            s   ˆ j  ˆ  |  ƒ | ƒ d  S(   N(   R&   (   t   valuet   expected(   RX   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_genericpath.pyt   checkÕ   s    t   spamt   hams	   $spam bars   %s bars
   ${spam}bars   %sbars   ${%s}bars   ham%sbars
   $bar%s bars	   $spam}bars   %s}baru	   $spam baru   %s baru
   ${spam}baru   %sbaru   ${%s}baru   ham%sbaru
   $bar%s baru	   $spam}baru   %s}bar(   R   R   Rj   RX   t   syst   getfilesystemencodingR    Rk   Rl   t   FS_NONASCIIt   encode(   R   Rq   t   encodingRm   t	   unonasciit	   snonascii(    (   RX   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_genericpath.pyt   test_expandvars_nonasciiÐ   s.    
	
c         C   sM   |  j  d |  j j d ƒ ƒ x* d D]" } |  j |  j j | ƒ t ƒ q# Wd  S(   NR2   R   s   fòòs   /foos   C:\(   R   R2   s   fòòs   /foos   C:\(   t   assertInR   RZ   t   assertIsInstancet   str(   R   t   path(    (    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_genericpath.pyt   test_abspathì   s    c         C   s    |  j  d |  j j d ƒ ƒ d  S(   NR2   (   R|   R   Rc   (   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_genericpath.pyt   test_realpathó   s    c         C   s1   x* d D]" } |  j  |  j j | ƒ t ƒ q Wd  S(   Nu    u   .u   /u   \u   ///foo/.//bar//(   u    u   .u   /u   \u   ///foo/.//bar//(   R}   R   RY   t   unicode(   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_genericpath.pyt   test_normpath_issue5827ö   s    c      	   C   s´   |  j  j } x$ d D] } |  j | | ƒ t ƒ q Wd } y  t j pH d } | j | ƒ Wn t t f k
 rr n> Xt j	 | ƒ �, x$ d	 D] } |  j | | ƒ t ƒ qŠ WWd  QXd  S(
   Nu    u   fuuu   fÃ¹Ã¹u   /fuuu   U:\u   Ã§wÃ°t   ascii(   u    u   fuuu   fÃ¹Ã¹u   /fuuu   U:\(   u    u   fuuu   fÃ¹Ã¹u   /fuuu   U:\(
   R   RZ   R}   R‚   R    t   TESTFN_ENCODINGRw   t   AttributeErrort   UnicodeEncodeErrort   temp_cwd(   R   RZ   R   t   unicwdt
   fsencoding(    (    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_genericpath.pyt   test_abspath_issue3426ü   s    t   darwinsE   Mac OS X denies the creation of a directory with an invalid utf8 namec         C   s$   t  j d ƒ � |  j ƒ  Wd  QXd  S(   Ns   çwð(   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_genericpath.pyt   test_nonascii_abspath  s    N(   R   RL   t   NoneR   R   R   Rd   Re   Rn   t   unittestt
   skipUnlessR    Rv   R{   R€   R�   t   requires_unicodeRƒ   R‹   t   skipIfRt   t   platformR�   (    (    (    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_genericpath.pyRM   ¡   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_genericpath.pyt	   test_main  s    t   __main__(   t   __doc__R�   t   testR    R   RE   Rt   R   t   TestCaseR   RM   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_genericpath.pyt   <module>   s   	Žw	