ó
wŪjc           @   s¦   d  d l  Z  d  d l m Z m Z m Z d  d l j Z d  d l Z e j Z e	 e	 e
 d  Z d   Z d e j f d     YZ d   Z e d k r¢ e j   n  d S(	   i’’’’N(   t   verboset   have_unicodet
   TestFailedc         C   sd  t  rO | r2 d t |   t |  t |  f GqO d t |   t |  f Gn  y |  | } Wn+ t k
 r | sy   n  t  r`d GHq`nÖ X| rÖ | d  k rÖ | | k rÖ t  r· d GHn  t d |  | | | f   n | rR| d  k	 rRt |  t |  k s| |  | |  k rRt  r"d GHn  d t |   t |  t |  t |  f GHn t  r`d GHn  d  S(   Ns   %s %% %s =? %s ...s   %s %% %s works? ...s   overflow (this is fine)t   nos   %r %% %r == %r != %rs   %s %% %s == %s != %st   yes(   R    t   reprt   OverflowErrort   Nonet   AssertionErrort   len(   t	   formatstrt   argst   outputt   limitt
   overflowokt   result(    (    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_format.pyt
   testformat   s2    #,-c         O   s3   t  |  | |  t r/ t  t |   | |  n  d  S(   N(   R   R   t   unicode(   R
   R   t   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_format.pyt   testboth1   s    t
   FormatTestc           B   s   e  Z d    Z d   Z RS(   c         C   sæ
  t  d dŪ d  t  d t j d f d t t  d dÜ d d t t  d dŻ d	 d t t  d
 dŽ d d t t  d dß d  t  d d d d f  t  d d d d f  t  d d d d f  t  d dą  t  d d d d f  t  d d d d f  t  d d d d f  t  d d d d f  t  d d d  t  d d d  t  d d d   t  d d d!  t  d" d d#  t  d" d d$  d% } t  d" | d&  t  d" | d'  t  d( | d'  t  d) | d'  t  d* | d+  t  d, | d-  t  d. | d/  t  d0 | d-  t  d1 | d2  t  d1 | d3  t  d4 | d5  t  d6 | d7  t  d8 | d9  t  d: | d&  t  d; | d&  t  d< | d=  t  d> | d?  t  d" t |  d@ dA  dB } t  d | dC  t  d | dD  t  dE | dD  t  dF | dD  t  dG | dH  t  dI | dJ  t  dK | dL  t  dM | dJ  t  dN | dO  t  dN | dP  t  dQ | dR  t  dS | dT  t  dU | dV  t  dW | dC  t  dX | dC  t  dY | dZ  t  d[ | d\  t  d] | d^  t  d_ | d`  t  da | db  t  dc | dd  t  dc | de  t  df | dg  t  dh | di  t  dj | dk  t  dl | dm  t  dn | dm  t  do | dm  t  dp | dq  t  dr | ds  t  dt | du  t  dr | ds  t  d t |  dv dA  dw } t  d | dx  t  d | dy  t  dz | dy  t  d{ | dy  t  d| | d}  t  d~ | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | dx  t  d | dx  t  d | d  t  d | d  t  d | d  t  d | dx  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d | d  t  d  | d  t  d” | d  t  d¢ | d£  t  d¤ | d£  t  d t |  d„ dA  t  d" d¦ d§  t  d" dØ d©  t  d" dŖ d§  t  d" d« d©  t  d" d¬ d§  t  dc d d­  t  dc d® d­  t  da d dÆ  t  da d® dÆ  t  dc d d­  t  d d d°  t  d d® d°  t  d d± d²  t  d d³ d²  t  d d± d²  t  d d³ d²  t  d" d± d²  t  d" d³ d²  t  dc d± d“  t  dc d³ d“  t  da d± dµ  t  da d³ dµ  t  d d¶ d§  t  d d· d©  t  d dø d§  t  d d¹ d©  t  d t d¶  d§  t  d dŗ d§  t  d d» d©  t  d d¼ d§  t  d d½ d©  t  d t dŗ  d§  t d¾ dæ dĄ  t dĮ dæ dĀ  dĆ t f dÄ     Y} |   } t d | d²  t dÅ | d²  t r	dĘ GHn  dĒ   } | dČ d t dÉ  t	 rß	| t
 dŹ dĖ  d t dĢ  n  | d" d t dĶ  | d¾ d t dĪ  | dĻ d t dŠ  | dĻ dŃ t dŠ  | dŅ d t dŠ  | dŅ dŃ t dŠ  dÓ t f dŌ     Y} | d |   t dÕ  t dā k r»
y dŲ t dŁ f Wn t k
 r®
q»
Xt dŚ  n  d  S(ć   Ns   %.1di   t   1s   %.*dR   s   %.100dtd   0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001s   %#.117xtw   0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001s   %#.118xtx   0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001s   %fg      š?s   1.000000s   %#.*gim   g:Ź~^Źg      @in   g}Ć%­I²Ōs   %12.*fi@ā s   %#.*Gs   %#.*fs   %#.*Fs   %xl   
 t   al    hķ] t
   174876e800s   %ot   12t   1351035564000s   %dt   10t   100000000000l   Ņ
~¹l!]c t   123456789012345678901234567890s   -123456789012345678901234567890s   %5ds   %31ds   %32ds     -123456789012345678901234567890s   %-32ds    -123456789012345678901234567890 s   %032ds    -0123456789012345678901234567890s   %-032ds   %034ds"   -000123456789012345678901234567890t"   0000123456789012345678901234567890s   %0+34ds"   +000123456789012345678901234567890s   %+34ds"      +123456789012345678901234567890s   %34ds"       123456789012345678901234567890s   %.2ds   %.30ds   %.31dt   0123456789012345678901234567890s   %32.31ds     0123456789012345678901234567890t   123456________________________i   l   E#ā=ó*H<V4$ t   1234567890abcdef12345s   -1234567890abcdef12345s   %5xs   %22xs   %23xs    -1234567890abcdef12345s   %-23xs   -1234567890abcdef12345 s   %023xs   -01234567890abcdef12345s   %-023xs   %025xs   -0001234567890abcdef12345t   00001234567890abcdef12345s   %0+25xs   +0001234567890abcdef12345s   %+25xs      +1234567890abcdef12345s   %25xs       1234567890abcdef12345s   %.2xs   %.21xs   %.22xt   01234567890abcdef12345s   %23.22xs    01234567890abcdef12345s   %-23.22xs   01234567890abcdef12345 s   %Xt   1234567890ABCDEF12345s   %#Xt   0X1234567890ABCDEF12345s   %#xt   0x1234567890abcdef12345s   -0x1234567890abcdef12345s   %#.23xs   -0x001234567890abcdef12345s   %#+.23xs   +0x001234567890abcdef12345s   %# .23xs    0x001234567890abcdef12345s   %#+.23Xs   +0X001234567890ABCDEF12345s   %#-+.23Xs
   %#-+26.23Xs
   %#-+27.23Xs   +0X001234567890ABCDEF12345 s	   %#+27.23Xs    +0X001234567890ABCDEF12345s
   %#+027.23Xs   +0X0001234567890ABCDEF12345t   123456_______________l   øKSp.'Į]w9
 t    12345670123456701234567012345670s!   -12345670123456701234567012345670s   %5os   %33os   %34os"    -12345670123456701234567012345670s   %-34os"   -12345670123456701234567012345670 s   %034os"   -012345670123456701234567012345670s   %-034os   %036os$   -00012345670123456701234567012345670t$   000012345670123456701234567012345670s   %0+36os$   +00012345670123456701234567012345670s   %+36os$      +12345670123456701234567012345670s   %36os$       12345670123456701234567012345670s   %.2os   %.32os   %.33ot!   012345670123456701234567012345670s   %34.33os"    012345670123456701234567012345670s   %-34.33os"   012345670123456701234567012345670 s   %#os   %#.34os#   -0012345670123456701234567012345670s   %#+.34os#   +0012345670123456701234567012345670s   %# .34os#    0012345670123456701234567012345670s   %#-+.34os
   %#-+37.34os%   +0012345670123456701234567012345670  s	   %#+37.34os%     +0012345670123456701234567012345670s   %#.33os   %#.32os   %034.33ot"   0012345670123456701234567012345670s	   %0#34.33ot    123456__________________________i*   t   42iÖ’’’s   -42l   * l’’’’* g      E@t   0x1l    t   0X1t   01i    t   0l    t   0x0t   0X0iB   i¾’’’l   B l’’’’B i"   iŽ’’’l   " l’’’’" s   %ggń?s   1.1s   %#gs   1.10000t   IntFailsc           B   s   e  Z d    Z d   Z RS(   c         S   s
   t   d  S(   N(   R   (   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_format.pyt   __int__ļ   s    c         S   s   d S(   Ni    (    (   R7   (    (    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_format.pyt   __long__ń   s    (   t   __name__t
   __module__R8   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_format.pyR6   ī   s   	u   %xs   Testing exceptionsc         S   s¢   y t  |  |  Wn} | k
 rt } t |  | k rF t rq d GHqq q t rT d GHn  d G| Gd Gt t |   GHn* t r d GHn  d GH  n Xt d |  d  S(   NR   R   s   Unexpected t   :s   Unexpected exceptions"   did not get expected exception: %s(   R   t   strR    R   R   (   R
   R   t	   exceptiont   excmsgt   exc(    (    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_format.pyt   test_excü   s       s   abc %as2   unsupported format character 'a' (0x61) at index 5s   abc %\u3000s   raw-unicode-escapes4   unsupported format character '?' (0x3000) at index 5s(   %d format: a number is required, not strs    float argument required, not strs	   no formats4   not all arguments converted during string formattingu   1u	   no formatt   Foobarc           B   s   e  Z d    Z RS(   c         S   s   |  d S(   Ni   (    (   R7   (    (    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_format.pyt   __oct__  s    (   R:   R;   RC   (    (    (    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_format.pyRB     s   s-   expected string or Unicode object, long foundi   i   s   %*di’’’s!   "%*d"%(maxsize, -127) should fail(   i   (   i   (   i   (   i   (   g      š?(   i@ā g      š?I       i’’’(   R   t   syst   maxintt   Truet   floatR   t   objectR    t
   ValueErrorR   R   t	   TypeErrort   longt   maxsizet   MemoryErrorR   (   R7   t   bigR6   t   fstRA   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_format.pyt   test_format8   s`   		
c            sµ  g  } xB d D]: } | j  d | d t f  | j  d | d t f  q Wx_ d d d d g D]K } xB d	 D]: } | j  d | | t f  | j  d | | t f  qk Wq^ W| j  d
 d t f  x9 d D]1 } x( d D]  } | j  d | | t f  q× WqŹ Wx9 d D]1 } x( d D]  } | j  d | | t f  qWqWd t f   f d     Y} xW | D]O \ }   } y | |   Wn | k
 rq^X|  j d | j |   f  q^Wd  S(   Nt   sriduoxXfget   %i   s   %#t    t   -t   Ls   -Lt   iduoxXs   %ot   abct   0abct   0xt   0xLt   xXt   Xc              sS   e  Z   f d    Z   f d   Z   f d   Z   f d   Z   f d   Z RS(   c            s     S(   N(    (   R7   (   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_format.pyt   __repr__A  s    c            s     S(   N(    (   R7   (   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_format.pyt   __str__C  s    c            s     S(   N(    (   R7   (   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_format.pyRC   E  s    c            s     S(   N(    (   R7   (   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_format.pyt   __hex__G  s    c            s     S(   N(    (   R7   (   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_format.pyt	   __float__I  s    (   R:   R;   R]   R^   RC   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_format.pyR\   @  s
   s!   %s not raised for %r format of %r(   RW   RX   RY   RZ   (   RY   RZ   (   t   appendRJ   RI   RK   t   failR:   (   R7   t   testst   ft   rR\   t   fmtR@   (    (   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_format.pyt   test_invalid_special_methods/  s.    """	(   R:   R;   RP   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_format.pyR   7   s   	÷c          C   s,   t  j t  d   }  t  j d    } d  S(   Nc      
   S   s  d } |  j  t | d  d  |  j  t | d  d  |  j t   } t | d t j d  Wd  QX|  j  t | j  d  t |  } |  j  t | d  d	  |  j  t | d  d
  |  j t   } t | d t j d  Wd  QX|  j  t | j  d  d  S(   Ng333333ó?s   .0fR   s   .3fs   1.200s   .%sfi   s   precision too bigs   1+0js   1.200+0.000j(	   t   assertEqualt   formatt   assertRaisesRI   RD   RL   R=   R>   t   complex(   R7   Rd   t   cmt   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_format.pyt   test_precisionX  s    c      
   S   s   d d l  m } d } |  j t   } t | d | d  Wd  QXt |  } |  j t   } t | d | d  Wd  QXd  S(   Ni’’’’(   t   INT_MAXg333333ó?s   .%sfi   (   t	   _testcapiRo   Rj   RI   Ri   Rk   (   R7   Ro   Rd   Rl   Rm   (    (    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_format.pyt   test_precision_c_limitsg  s    (   t   test_supportt   run_unittestR   t   cpython_only(   Rn   Rq   (    (    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_format.pyt	   test_mainU  s    	t   __main__(   RD   t   test.test_supportR    R   R   Rr   t   unittestt   MAX_Py_ssize_tRL   R   t   FalseR   R   t   TestCaseR   Ru   R:   t   main(    (    (    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_format.pyt   <module>   s   	$	’ 	