
    <ed                        d dl mZ d dlmZmZmZmZ d dlmZ d dl	Z	d dl
Z
d dlZd dlZ G d de	j                  Z G d de	j                  Z G d	 d
e          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de	j                  Z G d de	j                  Z G d dee          Z G d dee          Z G d dee          Z G d dee          Z G d d e	j                  Z G d! d"ee          Z G d# d$e	j                  Z G d% d&e	j                  Z G d' d(e          Z  G d) d*ee           Z! G d+ d,ee           Z" G d- d.ee           Z# G d/ d0e          Z$ G d1 d2ee$          Z% G d3 d4ee$          Z& G d5 d6ee$          Z'e(d7k    r e	j)                     dS dS )8    )Decimal)verbose
is_androidis_emscriptenis_wasi)check_warningsNc                   *    e Zd Zed             Zd ZdS )BaseLocalizedTestc                    t           j        dk    r^dd l}d}t          |                                j                            d          d                   dk     rt          j        d          n$t           j        	                    d          rd}nd	}	 t          j        t          j                  }|D ]9}	 t          j        t          j        |           n# t          j        $ r Y 4w xY w n*t          j        d
d                    |          z            || _        t          j        t          j        |           d S # t          j        t          j        |           w xY w)Ndarwinr   )en_US.UTF-8en_US.ISO8859-1en_US.
   z#Locale support on MacOSX is minimalwin)EnEnglish)r   r   en_US.US-ASCIIr   z$Test locale not supported (tried %s)z, )sysplatformosintunamereleasesplitunittestSkipTest
startswithlocale	setlocale
LC_NUMERICErrorjoinenUS_locale)clsr   tlocs	oldlocaletlocs        '/usr/lib/python3.11/test/test_locale.py
setUpClasszBaseLocalizedTest.setUpClass   sn   <8##III?E288::%++C00344r99 '(MNNN	 :
 \$$U++ 	0%EE0E	;():;;I K K$V%6====|   H' )58<		%8H8H)J K K K"COV.	:::::FV.	::::s0   "E  7CE  C)&E  (C))6E   !E!c                    t          j        | j                  }|                     t           j        | j        |           t          j        | j        | j                   t
          rt          d| j        z  dd           d S d S )Nztesting with %r... Tendflush)r    r!   locale_type
addCleanupr%   r   print)selfr(   s     r*   setUpzBaseLocalizedTest.setUp-   s    $T%566	($*:IFFF)4+;<<< 	P&)99s$OOOOOO	P 	P    N)__name__
__module____qualname__classmethodr+   r5    r6   r*   r
   r
   
   sC        
 ; ; [;:P P P P Pr6   r
   c                       e Zd Zd Zd ZdS )BaseCookedTestc                 (    | j         t          _        d S N)cooked_valuesr    _override_localeconvr4   s    r*   r5   zBaseCookedTest.setUp:   s    &*&8###r6   c                     i t           _        d S r?   )r    rA   rB   s    r*   tearDownzBaseCookedTest.tearDown=   s    &(###r6   N)r7   r8   r9   r5   rD   r;   r6   r*   r=   r=   5   s2        
9 9 9) ) ) ) )r6   r=   c                       e Zd Zi dddddddg ddd	dd
ddg ddddddddddddddddddddiZdS )CCookedTestcurrency_symbol decimal_pointr   frac_digits   groupingint_curr_symbolint_frac_digitsmon_decimal_pointmon_groupingmon_thousands_sepn_cs_precedesn_sep_by_spacen_sign_posnnegative_signp_cs_precedesp_sep_by_spacep_sign_posnpositive_signthousands_sepNr7   r8   r9   r@   r;   r6   r*   rF   rF   @   s        2 	s 	B	
 	2 	3 	R 	 	R 	 	# 	s 	 	 	#  	s!" 	#$ 	% MMMr6   rF   c                       e Zd Zi dddddddg dd	d
dddddg dddddddddddddddddddddiZdS )EnUSCookedTestrG   $rI   r   rJ      rL      ra   r   rM   zUSD rN   rO   rP   rQ   ,rR      rS   r   rT   rU   -rV   rW   rX   rY   rH   rZ   Nr[   r;   r6   r*   r]   r]   X   s        3 	q 	III	
 	6 	1 	S 				 	S 	 	! 	q 	 	 	!  	q!" 	#$ 	% MMMr6   r]   c                       e Zd Zi dddddddg dd	d
dddddg dddddddddddddddddddddiZdS )FrFRCookedTestrG      €rI   rb   rJ   r_   rL   r`   rM   zEUR rN   rO   rP   rQ   r-   rR   r   rS   rc   rT   rU   rd   rV   rW   rX   rY   rH   rZ   Nr[   r;   r6   r*   rf   rf   q   s        8 	q 	III	
 	6 	1 	S 				 	S 	 	! 	q 	 	 	!  	q!" 	#$ 	% MMMr6   rf   c                   &    e Zd Zd Zd Zd Zd ZdS )BaseFormattingTestc                 B    |                       |||fi ||           d S r?   )assertEqual)r4   formatvalueoutfuncformat_optss         r*   _test_formatfuncz#BaseFormattingTest._test_formatfunc   s=    D..+..	5 	5 	5 	5 	5r6   c                     t          dt          f          5   | j        |||fdt          j        i| d d d            d S # 1 swxY w Y   d S )NrH   ro   )r   DeprecationWarningrq   r    rl   r4   rl   rm   rn   rp   s        r*   _test_formatzBaseFormattingTest._test_format   s    R!3455 	3 	3!D!&% 3 3]3&13 3 3	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3s   AAAc                 >     | j         |||fdt          j        i| d S )Nro   )rq   r    format_stringrt   s        r*   _test_format_stringz&BaseFormattingTest._test_format_string   sA    feS 	6 	6%	6)4	6 	6 	6 	6 	6r6   c                 R    |                      t          j        |fi ||           d S r?   )rk   r    currency)r4   rm   rn   rp   s       r*   _test_currencyz!BaseFormattingTest._test_currency   s0    >>+>>DDDDDr6   N)r7   r8   r9   rq   ru   rx   r{   r;   r6   r*   ri   ri      sU        
5 5 53 3 3
6 6 6E E E E Er6   ri   c                   D    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
S )EnUSNumberFormattingc                 B    t          j                    d         | _        d S )NrZ   )r    
localeconvseprB   s    r*   r5   zEnUSNumberFormatting.setUp   s    $&&7r6   c                     |                      dddd| j        z             |                      dddd           |                      dddd	           |                      d
ddd	           d S )N%f   rc   z1%s024.000000rL   rn   f   
102.000000
-42.000000%+fru   r   rB   s    r*   test_groupingz"EnUSNumberFormatting.test_grouping   s    $qo6PQQQ$a\BBB$a\BBB%qlCCCCCr6   c                 @   |                      dddd                    d                     | j        rj|                      dddd	| j        z                      d
                     |                      dddd	| j        z                      d
                     d S d S )N%20.fr   rc   -42   r   %+10.f-4%s200r   %-10.f)ru   rjustr   ljustrB   s    r*   test_grouping_and_paddingz.EnUSNumberFormatting.test_grouping_and_padding   s    '3BHHH8 	6h)0044  6 6 6h)0044  6 6 6 6 6	6 	6r6   c                     |                      dddd| j        z             |                      dddd| j        z             |                      dddd	| j        z             d S )
N%dh  T4%s200r   z%+dz+4%s200r   r   r   rB   s    r*   test_integer_groupingz*EnUSNumberFormatting.test_integer_grouping   st    $tDH9LMMM%)dh:NOOO%9tx;OPPPPPr6   c                     |                      dddd| j        z                      d                     |                      dddd	| j        z                      d                     d S )
N%10dr   Tr   r   r   %-10dr   r   )ru   r   r   r   rB   s    r*   !test_integer_grouping_and_paddingz6EnUSNumberFormatting.test_integer_grouping_and_padding   s    &$DH$++B// 	 	1 	1 	1'54TX%,,R00 	 	2 	2 	2 	2 	2r6   c                     |                      dddd           |                      dddd           |                      dddd	           |                      d
ddd	           d S )Nr   r   r   z1024.000000r   r   r   r   r   r   ru   rB   s    r*   test_simplez EnUSNumberFormatting.test_simple   s|    $qmDDD$a\BBB$a\BBB%qlCCCCCr6   c                    |                      dddd                    d                     |                      dddd	                    d
                     |                      dddd                    d
                     d S )Nr   r   r   r   r   r   r   r   z-4200r   r   r   4200ru   r   r   rB   s    r*   test_paddingz!EnUSNumberFormatting.test_padding   s    '3BHHH(EA7==;L;LMMM(D1&,,r:J:JKKKKKr6   c                     |                      t                    5  t          j        ddd           d d d            d S # 1 swxY w Y   d S )Nr   r   TrL   )assertWarnsrs   r    rl   rB   s    r*   test_format_deprecationz,EnUSNumberFormatting.test_format_deprecation   s    011 	9 	9M(D48888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9s   A  AAc           
         |                      dddd| j        d| j        d           |                      dddd| j        d| j        d           |                      d	d
d           | j        r7|                      ddddd| j        z                      d          z              |                      dddd                    d                     | j        r4|                      dddd| j        z                      d                     | j        r,|                      dddd| j        d| j        d           d S d S )NzOne million is %ii@B rc   zOne million is 1000r   zOne  million is %izOne  million is 1z.%f.     @@z.1000.000000.rn   z-->  %10.2fr   z-->  z	4%s200.00r   z%10.*f)r_     r   z1000.00z%*.*f)r   r_   r   z	1%s000.00zint %i float %.2f str %s)r   r   strzint 1z000 float 1z000.00 str str)rx   r   r   rB   s    r*   test_complex_formattingz,EnUSNumberFormatting.test_complex_formatting   s     !4g04$(((C 	! 	E 	E 	E  !5w154888D 	! 	F 	F 	F 	  _ EEE8 	B$$]D1{TX5<<R@@@ % B B B 	  9q## 	! 	% 	% 	%8 	8$$Wma 48+22266 % 8 8 8 8 	&$$%?%4888% % & & & & &	& 	&r6   N)r7   r8   r9   r5   r   r   r   r   r   r   r   r   r;   r6   r*   r}   r}      s        8 8 8D D D6 6 6Q Q Q
2 2 2D D DL L L
9 9 9& & & & &r6   r}   c                       e Zd Zd ZdS )TestFormatPatternArgc                    t          dt          f          5  |                     t          t          j        dd           |                     t          t          j        dd           |                     t          t          j        dd           |                     t          t          j        dd           |                     t          t          j        dd           |                     t          t          j        dd           |                     t          t          j        d	d           d d d            d S # 1 swxY w Y   d S )
NrH   z%f
fooz%fz%f
z %fz%fgz%^g%f%%)r   rs   assertRaises
ValueErrorr    rl   rB   s    r*   test_onlyOnePatternz(TestFormatPatternArg.test_onlyOnePattern   sR   R!3455 	H 	Hj&-GGGj&-GGGj&-5IIIj&-FFFj&-FFFj&-FFFj&-GGG	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	Hs   DD66D:=D:N)r7   r8   r9   r   r;   r6   r*   r   r      s(        	H 	H 	H 	H 	Hr6   r   c                       e Zd ZdZd Zd ZdS )TestLocaleFormatStringz%General tests on locale.format_stringc                    |                      t          j        dd          ddz             |                      t          j        dd          ddz             |                      t          j        dddi          dddiz             d S )Nr         ?z%d %f%%d)rc   r   z%(foo)s %%dr   barrk   r    rw   rB   s    r*   test_percent_escapez*TestLocaleFormatString.test_percent_escape   s    -fc::FSLIII-j(CC!	# 	# 	#-meU^LLeU^+	. 	. 	. 	. 	.r6   c                     |                      t          j        dddi          dddiz             |                      t          j        dddi          dddiz             d S )Nz%(foo)s bing.r   r   z%(foo)sr   rB   s    r*   test_mappingz#TestLocaleFormatString.test_mapping  sz    -ou~NNu~-	0 	0 	0-i%HH%'	* 	* 	* 	* 	*r6   N)r7   r8   r9   __doc__r   r   r;   r6   r*   r   r      s8        //. . .* * * * *r6   r   c                   "    e Zd Zej        Zd ZdS )TestNumberFormattingc                 n    t                               |            t                              |            d S r?   )r
   r5   r}   rB   s    r*   r5   zTestNumberFormatting.setUp  s0    %%%""4(((((r6   N)r7   r8   r9   r    r"   r1   r5   r;   r6   r*   r   r     s-         #K) ) ) ) )r6   r   c                       e Zd Zd Zd ZdS )TestEnUSNumberFormattingc                 n    t                               |            t                              |            d S r?   )r]   r5   r}   rB   s    r*   r5   zTestEnUSNumberFormatting.setUp  s0    T"""""4(((((r6   c                     |                      dd           |                      ddd           |                      dddd           d S )NP  z	$50000.00z
$50,000.00Tr   zUSD 50,000.00rL   internationalr{   rB   s    r*   test_currencyz&TestEnUSNumberFormatting.test_currency  sc    E;///E<$???E? 	 	/ 	/ 	/ 	/ 	/r6   N)r7   r8   r9   r5   r   r;   r6   r*   r   r     s2        ) ) )/ / / / /r6   r   c                       e Zd Zd Zd ZdS )TestCNumberFormattingc                 8    |                      dddd           d S )N%.2f)\@Tz12345.67r   r   rB   s    r*   r   z#TestCNumberFormatting.test_grouping&  s%    &(TzJJJJJr6   c                 8    |                      dddd           d S )N%9.2fr   Tz	 12345.67r   r   rB   s    r*   r   z/TestCNumberFormatting.test_grouping_and_padding)  s%    '8dLLLLLr6   N)r7   r8   r9   r   r   r;   r6   r*   r   r   #  s:        K K KM M M M Mr6   r   c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestFrFRNumberFormattingc                 6    |                      ddd           d S )Nr   r   z12345,67r   r   rB   s    r*   test_decimal_pointz+TestFrFRNumberFormatting.test_decimal_point0  s#    &(
;;;;;r6   c                 j    |                      dddd           |                      dddd           d S )Nr   Qu@T345,67r   r   	12 345,67r   rB   s    r*   r   z&TestFrFRNumberFormatting.test_grouping3  sB    &&4XFFF&(T{KKKKKr6   c                    |                      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ddd           |                      dd	dd
           |                      dd	dd
           |                      dd	dd           d S )Nz%6.2fr   Tr   r   z%7.2fz 345,67z%8.2fr   r   r   z%10.2fz
 12 345,67z%-6.2fz%-7.2fz345,67 z%-8.2fz%-9.2fz%-10.2fz
12 345,67 r   rB   s    r*   r   z2TestFrFRNumberFormatting.test_grouping_and_padding7  s*   '6DhGGG'6DiHHH'8dLLL'8dLLL(HtNNN(FTxHHH(FTyIII(HtMMM(HtMMM)X,OOOOOr6   c                 j    |                      dddd           |                      dddd           d S )Nr      T200r   r   4 200r   rB   s    r*   r   z.TestFrFRNumberFormatting.test_integer_groupingC  sB    $d>>>$tAAAAAr6   c                 ~   |                      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                    d                     d S )Nz%4dr   Tr   r   z%5dr   r   z%-4dz%-5dr   r   rB   s    r*   r   z:TestFrFRNumberFormatting.test_integer_grouping_and_paddingG  s    %'BBB%'BBB&$7==;L;LMMM&$7CCC&$7CCC'4$GMM"<M<MNNNNNr6   c                     d}|                      dd|z              |                      dd|z   d           |                      dddd           d S )	Nrg   r   z	50000,00 z
50 000,00 Tr   z50 000,00 EURr   r   )r4   euros     r*   r   z&TestFrFRNumberFormatting.test_currencyO  sr    E;#5666E<$#6FFFE? 	 	/ 	/ 	/ 	/ 	/r6   N)	r7   r8   r9   r   r   r   r   r   r   r;   r6   r*   r   r   -  sz        < < <L L L
P 
P 
PB B BO O O/ / / / /r6   r   c                       e Zd Zd Zd ZdS )TestCollationc                    |                      t          j        dd          d           |                     t          j        dd          d           |                     t          j        dd          d           |                     t          t          j        dd           |                     t          t          j        dd           d S )Nabr   a )
assertLessr    strcollrk   assertGreaterr   r   rB   s    r*   test_strcollzTestCollation.test_strcollZ  s    sC00!444S1115556>#s33Q777*fneSAAA*fnc5AAAAAr6   c                     |                      t          j        d          t          j        d                     |                     t          t          j        d           d S )Nr   r   r   )r   r    strxfrmr   r   rB   s    r*   test_strxfrmzTestCollation.test_strxfrmb  sJ    s++V^C-@-@AAA*fne<<<<<r6   N)r7   r8   r9   r   r   r;   r6   r*   r   r   W  s5        B B B= = = = =r6   r   c                   N   e Zd Zej        Zd Z ej        e	j
                            d          d           ej        eped          d                         Z ej        e	j
                            d          d           ej        eped          d                         ZdS )TestEnUSCollationc                 b   t          j        t          j                    pd          j        }|dvrt          j        d          |dk    rJt          j        dk    s&t          st          j        
                    d          rt          j        d          t                              |            d S )Nascii)zutf-8	iso8859-1cp1252zencoding not suitabler   r   freebsdzwcscoll/wcsxfrm have known bugs)codecslookupr    getencodingnamer   r   r   r   r   r   r
   r5   r4   encs     r*   r5   zTestEnUSCollation.setUpm  s    mF.00;G<<A666#$;<<<+3<8#;#;z#;#&<#:#:9#E#E $<#$EFFF%%%%%r6   aixzbpo-29972: broken test on AIXz-musl libc issue on Emscripten/WASI, bpo-46390c                 X    |                      t          j        dd          d           d S )N   àr   r   )r   r    r   rB   s    r*   test_strcoll_with_diacriticz-TestEnUSCollation.test_strcoll_with_diacriticv  s*     	tS11155555r6   c                 z    |                      t          j        d          t          j        d                     d S )Nr  r   )r   r    r   rB   s    r*   test_strxfrm_with_diacriticz-TestEnUSCollation.test_strxfrm_with_diacritic  s2     	t,,fnS.A.ABBBBBr6   N)r7   r8   r9   r    LC_ALLr1   r5   r   skipIfr   r   r   r   r   r  r  r;   r6   r*   r   r   h  s         -K& & & X_S\,,U3346 6X_ 7 6 6	 6 66 X_S\,,U3346 6X_ 7 C C	 6 6C C Cr6   r   c                   V    e 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S )NormalizeTestc                 Z    |                      t          j        |          ||           d S )N)msg)rk   r    	normalize)r4   
localenameexpecteds      r*   checkzNormalizeTest.check  s.    )*55xZPPPPPr6   c                     t           j                                        D ]K\  }}|                     ||f          5  |                     ||           d d d            n# 1 swxY w Y   Ld S )N)r    )r    locale_aliasitemssubTestr  )r4   r  aliass      r*   test_locale_aliaszNormalizeTest.test_locale_alias  s    !'!4!:!:!<!< 	. 	.Jj%%899 . .

:u---. . . . . . . . . . . . . . .	. 	.s   AA#	&A#	c                 2    |                      dd           d S NrH   r  rB   s    r*   
test_emptyzNormalizeTest.test_empty  s    

2rr6   c                 ^    |                      dd           |                      dd           d S )NcCposixr  rB   s    r*   test_czNormalizeTest.test_c  s0    

3

7C     r6   c                    |                      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d           |                      dd           |                      dd           d S )Nenr   ENzen.iso88591r   en_usen_GBzen_GB.ISO8859-1r   z
en_US.utf8zen_US:UTF-8r   zen_US.88591zen_US.885915en_US.ISO8859-15englishzen_EN.ISO8859-1zenglish_uk.asciir  rB   s    r*   test_englishzNormalizeTest.test_english  sC   

4*+++

4*+++

="3444

7-...

7-...

7-...

=-000

<///

=-000

$&7888

#%6777

="3444

>#5666

9/000

%'899999r6   c                 B   |                      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d           d S )Nzaz_AZ.iso88599ezaz_AZ.ISO8859-9Eztt_RU.koi8cztt_RU.KOI8-Czlo_LA.cp1133zlo_LA.IBM-CP1133zlo_LA.ibmcp1133zuk_ua.microsoftcp1251zuk_UA.CP1251zuk_ua.microsoft-cp1251zka_ge.georgianacademyzka_GE.GEORGIAN-ACADEMYzcs_CZ.iso88592zcs_CZ.ISO8859-2r  rB   s    r*   test_hyphenated_encodingz&NormalizeTest.test_hyphenated_encoding  s   

$&8999

%'9:::

=.111

>>222

>#5666

$&8999

%'9:::

*N;;;

+^<<<

*,DEEE

+-EFFF

#%6777

$&788888r6   c                     |                      dd           |                      dd           |                      dd           d S )Nz
de_DE@eurozde_DE.ISO8859-15zen_US.ISO8859-15@euror%  zde_DE.utf8@eurozde_DE.UTF-8r  rB   s    r*   test_euro_modifierz NormalizeTest.test_euro_modifier  sH    

<!3444

*,>???

$m44444r6   c                     |                      dd           |                      dd           |                      dd           d S )Nzbe_BY.UTF-8@latinzsr_RS.UTF-8@latinzsr_RS.UTF-8@latnr  rB   s    r*   test_latin_modifierz!NormalizeTest.test_latin_modifier  sJ    

&(;<<<

&(;<<<

%':;;;;;r6   c                     |                      dd           |                      dd           |                      dd           d S )Nzca_ES.UTF-8@valenciazca_ES@valenciazca@valenciazca_ES.ISO8859-1@valenciar  rB   s    r*   test_valencia_modifierz$NormalizeTest.test_valencia_modifier  sI    

)+ABBB

#%;<<<

="<=====r6   c                    |                      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 S )Nzks_IN.UTF-8@devanagarizks_IN@devanagarizks@devanagarizks_IN.UTF-8ks_INkszsd_IN.UTF-8@devanagarizsd_IN@devanagarizsd@devanagarizsd_IN.UTF-8sd_INsdr  rB   s    r*   test_devanagari_modifierz&NormalizeTest.test_devanagari_modifier  s   

+-EFFF

%'?@@@

?$<===

=-000

7M***

4'''

+-EFFF

%'?@@@

?$<===

=-000

7M***

4'''''r6   c                 :   |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      d	d
           |                      dd
           d S )N	ja_jp.eucja_JP.eucJPja_jp.eucjpz	ko_kr.euczko_KR.eucKRzko_kr.euckrz	zh_cn.euczzh_CN.eucCNz	zh_tw.euczzh_TW.eucTWzzh_tw.euctwr  rB   s    r*   test_euc_encodingzNormalizeTest.test_euc_encoding  s    

;...

=-000

;...

=-000

;...

;...

=-00000r6   c                    |                      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d           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           d S )Njar8  zja.jisz
ja_JP.JIS7zja.sjisz
ja_JP.SJISja_jpz
ja_jp.ajecr7  r9  zja_jp.iso-2022-jpzja_jp.iso2022jpz	ja_jp.jisz
ja_jp.jis7zja_jp.mscodez	ja_jp.pckz
ja_jp.sjisz
ja_jp.ujisz
ja_jp.utf8zja_JP.UTF-8japanjapanesezjapanese-euczjapanese.euczjapanese.sjisjp_jpr  rB   s    r*   test_japanesezNormalizeTest.test_japanese  s   

4'''

8\***

9l+++

7M***

<///

;...

=-000

&555

$l333

;---

<...

><000

;---

<...

<///

<///

7M***

:}---

>=111

>=111

?L111

7M*****r6   N)r7   r8   r9   r  r  r  r  r'  r)  r+  r-  r/  r5  r:  rA  r;   r6   r*   r
  r
    s        Q Q Q. . .
  ! ! !: : :"9 9 95 5 5
< < <
> > >
( ( (1 1 1+ + + + +r6   r
  c                   >    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	S )
TestMiscellaneousc                 d   dd l }dd l}|                     t          j        d          d           t          |d          r
|j        }|`nd }i }	 dD ]#}||j        v r|j        |         ||<   |j        |= $d|j        d<   t          dt          f          5  |                     t          j
                    d           d d d            n# 1 swxY w Y   |D ]}||         |j        |<   d|vr|j        d= |	||_        d S d S # |D ]}||         |j        |<   d|vr|j        d= |||_        w xY w)Nr   UTF-8)NrE  _getdefaultlocale)r  LC_CTYPELANGLANGUAGErG  rH   )_localer   rk   r    _parse_localenamehasattrrF  environr   rs   getdefaultlocale)r4   rJ  r   orig_getlocaleorig_envkeyks          r*   test_defaults_UTF8z$TestMiscellaneous.test_defaults_UTF8  s    				1'::OLLL7/00 	"$6N))!N	;A ( ("*$$$&JsOHSM
3%,BJz"%7 899 M M  !8!:!:OLLLM M M M M M M M M M M M M M M  , , (
1))Jz*),:))) *)  , , (
1))Jz*),:)::::s1   AD (C
>D 
CD CD ,D/c                     t          j                    }|                     |t                     |                     |d           t          j        |           d S r  )r    r   assertIsInstancer   assertNotEqualr   r   r   s     r*   test_getencodingz"TestMiscellaneous.test_getencoding  sR     ""c3'''C$$$cr6   c                 \    t          j                    }|rt          j        |           d S d S r?   )r    getpreferredencodingr   r   r   s     r*   test_getpreferredencodingz+TestMiscellaneous.test_getpreferredencoding&  s8    )++ 	M#	 	r6   c                     |                      t          t          j        dd            |                      t          t          j        dd            d S )Nr      a)r   	TypeErrorr    r   rB   s    r*   test_strcoll_3303z#TestMiscellaneous.test_strcoll_3303-  s@    )V^S$???)V^T4@@@@@r6   c                    t          j        t           j                   t          j        t           j                   t          j        t           j                   t          j        t           j                   t          j        t           j                   t          j        t           j                   |                     t           j	        t           j        d           d S )Ni90  )
r    r!   r  LC_TIMErG  
LC_COLLATELC_MONETARYr"   r   r#   rB   s    r*   test_setlocale_categoryz)TestMiscellaneous.test_setlocale_category2  s    '''((()))*++++,,,*+++ 	&,(8%@@@@@r6   c                    t          j        t           j                  }|                     t           j        t           j        |           	 t          j        t           j        d           n*# t           j        $ r |                     d           Y nw xY wt          j        t           j                  }t          rt          d|dd           	 t          j        t           j        |           n7# t           j        $ r%}|                     d|d|           Y d }~nd }~ww xY w| 	                    |t          j        t           j                             d S )	Ntr_TRztest needs Turkish localeztesting with r-   Tr.   zsetlocale(LC_CTYPE, z
) failed: )
r    r!   rG  r2   r#   skipTest	getlocaler   r3   rk   )r4   r(   locexcs       r*   test_getsetlocale_issue1813z-TestMiscellaneous.test_getsetlocale_issue1813=  s]   $V_55	(&/9EEE	7V_g6666| 	7 	7 	7MM566666	7 v// 	CEss,#TBBBB	KV_c2222| 	K 	K 	K MMIII#IIJJJJJJJJ		K
 	f.v??@@@@@s*   A+ +$BBC0 0D$?DD$c                     |                      t                    5  t          j        t          j        d           d d d            d S # 1 swxY w Y   d S )Ns   fi_FIr   r]  r    r!   r  rB   s    r*   )test_invalid_locale_format_in_localetuplez;TestMiscellaneous.test_invalid_locale_format_in_localetupleR  s    y)) 	6 	6V]H555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6    AAAc                     |                      t                    5  t          j        t          j        d           d d d            d S # 1 swxY w Y   d S )N)s   nots   validrl  rB   s    r*   $test_invalid_iterable_in_localetuplez6TestMiscellaneous.test_invalid_iterable_in_localetupleV  s    y)) 	@ 	@V],>???	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@rn  N)r7   r8   r9   rS  rW  rZ  r^  rc  rj  rm  rp  r;   r6   r*   rC  rC    s        #; #; #;J    A A A
	A 	A 	AA A A*6 6 6@ @ @ @ @r6   rC  c                        e Zd Zd Zd Zd ZdS )BaseDelocalizeTestc                 V    |                      t          j        |          |           d S r?   )rk   r    
delocalizer4   rm   rn   s      r*   _test_delocalizez#BaseDelocalizeTest._test_delocalize]  s)    *511377777r6   c                 V    |                      t          j        |          |           d S r?   )rk   r    atofru  s      r*   
_test_atofzBaseDelocalizeTest._test_atof`  (    U++S11111r6   c                 V    |                      t          j        |          |           d S r?   )rk   r    atoiru  s      r*   
_test_atoizBaseDelocalizeTest._test_atoic  rz  r6   N)r7   r8   r9   rv  ry  r}  r;   r6   r*   rr  rr  [  sA        8 8 82 2 22 2 2 2 2r6   rr  c                        e Zd Zd Zd Zd ZdS )TestEnUSDelocalizec                 ^    |                      dd           |                      dd           d S )N50000.00	50,000.00rv  rB   s    r*   test_delocalizez"TestEnUSDelocalize.test_delocalizei  4    j*555k:66666r6   c                 ^    |                      dd           |                      dd           d S )Nr       j@r  ry  rB   s    r*   	test_atofzTestEnUSDelocalize.test_atofm  0    
F+++V,,,,,r6   c                 ^    |                      dd           |                      dd           d S )N50000r   z50,000r}  rB   s    r*   	test_atoizTestEnUSDelocalize.test_atoiq  0    '''%(((((r6   Nr7   r8   r9   r  r  r  r;   r6   r*   r  r  g  A        7 7 7- - -) ) ) ) )r6   r  c                        e Zd Zd Zd Zd ZdS )TestCDelocalizeTestc                 2    |                      dd           d S Nr  r  rB   s    r*   r  z#TestCDelocalizeTest.test_delocalizex  s    j*55555r6   c                 2    |                      dd           d S )Nr  r  r  rB   s    r*   r  zTestCDelocalizeTest.test_atof{  s    
F+++++r6   c                 2    |                      dd           d S )Nr  r   r  rB   s    r*   r  zTestCDelocalizeTest.test_atoi~  s    '''''r6   Nr  r;   r6   r*   r  r  v  sA        6 6 6, , ,( ( ( ( (r6   r  c                        e Zd Zd Zd Zd ZdS )TestfrFRDelocalizeTestc                 ^    |                      dd           |                      dd           d S )N50000,00r  	50 000,00r  rB   s    r*   r  z&TestfrFRDelocalizeTest.test_delocalize  r  r6   c                 ^    |                      dd           |                      dd           d S )Nr  r  r  r  rB   s    r*   r  z TestfrFRDelocalizeTest.test_atof  r  r6   c                 ^    |                      dd           |                      dd           d S )Nr  r   z50 000r  rB   s    r*   r  z TestfrFRDelocalizeTest.test_atoi  r  r6   Nr  r;   r6   r*   r  r    r  r6   r  c                       e Zd ZddZdS )BaseLocalizeTestFc                 Z    |                      t          j        ||          |           d S )Nr   )rk   r    localize)r4   rm   rn   rL   s       r*   _test_localizezBaseLocalizeTest._test_localize  s-    BBBCHHHHHr6   N)F)r7   r8   r9   r  r;   r6   r*   r  r    s.        I I I I I Ir6   r  c                       e Zd Zd ZdS )TestEnUSLocalizec                     |                      dd           |                      d                    t          d                    d           d S )Nr  z{0:.16f}z1.15z1.1500000000000000)r  rl   r   rB   s    r*   test_localizezTestEnUSLocalize.test_localize  sY    J
333gfoo..0D	F 	F 	F 	F 	Fr6   Nr7   r8   r9   r  r;   r6   r*   r  r    s(        F F F F Fr6   r  c                       e Zd Zd ZdS )TestCLocalizec                 2    |                      dd           d S r  r  rB   s    r*   r  zTestCLocalize.test_localize  s    J
33333r6   Nr  r;   r6   r*   r  r    s#        4 4 4 4 4r6   r  c                       e Zd Zd ZdS )TestfrFRLocalizec                 b    |                      dd           |                      ddd           d S )Nr  r  r  Tr   r  rB   s    r*   r  zTestfrFRLocalize.test_localize  s9    J
333JdCCCCCr6   Nr  r;   r6   r*   r  r    s(        D D D D Dr6   r  __main__)*decimalr   test.supportr   r   r   r   test.support.warnings_helperr   r   r    r   r   TestCaser
   r=   rF   r]   rf   objectri   r}   r   r   r   r   r   r   r   r   r
  rC  rr  r  r  r  r  r  r  r  r7   mainr;   r6   r*   <module>r     sQ         D D D D D D D D D D D D 7 7 7 7 7 7   



 (P (P (P (P (P) (P (P (PV	) 	) 	) 	) 	)X& 	) 	) 	)    .   0    ^   2    ^   4E E E E E E E E,F& F& F& F& F&- F& F& F&RH H H H H8, H H H* * * * *X. * * *$) ) ) ) ),.B ) ) )/ / / / /~/C / / /M M M M MK); M M M'/ '/ '/ '/ '/~/A '/ '/ '/T= = = = =H% = = ="C C C C C)= C C CBl+ l+ l+ l+ l+H% l+ l+ l+^`@ `@ `@ `@ `@) `@ `@ `@F	2 	2 	2 	2 	2* 	2 	2 	2) ) ) ) )); ) ) )	( 	( 	( 	( 	(+'9 	( 	( 	() ) ) ) )^-? ) ) )I I I I I( I I IF F F F F~'7 F F F4 4 4 4 4K!1 4 4 4D D D D D~'7 D D D zHMOOOOO r6   