ó
‹wÛjc           @   ss   d  d l  Z  d  d l Z d  d l m Z e j d ƒ Z d e j f d „  ƒ  YZ d „  Z e	 d k ro e ƒ  n  d S(   iÿÿÿÿN(   t   test_supportt   pwdt   PwdTestc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   si  t  j ƒ  } xV| D]N} |  j t | ƒ d ƒ |  j | d | j ƒ |  j | j t ƒ |  j | d | j ƒ |  j | j t ƒ |  j | d | j ƒ |  j | j t	 t
 f ƒ |  j | d | j ƒ |  j | j t	 t
 f ƒ |  j | d | j ƒ |  j | j t ƒ |  j | d | j ƒ |  j | j t ƒ |  j | d | j ƒ |  j | j t ƒ q Wd  S(	   Ni   i    i   i   i   i   i   i   (   R   t   getpwallt   assertEqualt   lent   pw_namet   assertIsInstancet
   basestringt	   pw_passwdt   pw_uidt   intt   longt   pw_gidt   pw_gecost   pw_dirt   pw_shell(   t   selft   entriest   e(    (    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_pwd.pyt   test_values	   s"    c         C   sÿ   t  j ƒ  } i  } i  } t | ƒ d k r: |  j d ƒ n  xF | D]> } | j | j g  ƒ j | ƒ | j | j g  ƒ j | ƒ qA Wxu | D]m } | d sŠ | d d k r± qŠ n  |  j t  j	 | j ƒ | | j ƒ |  j t  j
 | j ƒ | | j ƒ qŠ Wd  S(   Niè  s*   passwd file is huge; extended test skippedi    t   +(   R   R   R   t   skipTestt
   setdefaultR   t   appendR
   t   assertInt   getpwnamt   getpwuid(   R   R   t   entriesbynamet   entriesbyuidR   (    (    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_pwd.pyt   test_values_extended#   s     #c         C   s&  |  j  t t j ƒ |  j  t t j d ƒ |  j  t t j ƒ |  j  t t j d ƒ |  j  t t j d ƒ i  } i  } x= t j ƒ  D]/ \ } } } } } } }	 | | | <| | | <q� W| j ƒ  }
 d } |
 | } xÈ | | k ršt | ƒ } xš t t	 | ƒ ƒ D]Y } | | d k r"d | | <Pqþ | | d k r8qþ qþ t
 t | | ƒ d ƒ | | <Pqþ W| d } y |
 | } Wn t k
 r‡Pn Xd j | ƒ } qÓ W|  j  t t j | ƒ t j } |  j | | ƒ |  j  t t j | ƒ |  j  t t j d	 ƒ |  j  t t j d ƒ |  j  t t j d ƒ d  S(   Ng…ëQ¸	@i*   i    t   zt   At   Zi   t    iÿÿÿÿi   i€   l	                    l	                    l÷ÿÿÿ                 (   t   assertRaisest	   TypeErrorR   R   R   R   t   keyst   listt   xrangeR   t   chrt   ordt
   IndexErrort   joint   KeyErrort   syst   maxintt   assertNotIn(   R   t   bynamest   byuidst   nt   pt   ut   gt   gecost   dt   st   allnamest   nameit   fakenamet   charst   it   fakeuid(    (    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_pwd.pyt   test_errors7   sH    (



	(   t   __name__t
   __module__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_pwd.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_pwd.pyt	   test_mainn   s    t   __main__(
   R-   t   unittestt   testR    t   import_moduleR   t   TestCaseR   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_pwd.pyt   <module>   s   g	