
    9bhH                        d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ  ej                  d      Zd dlmZmZ 	 d dlZd	Zd
Zd dlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ ejJ                  jL                  Z' e(d      Z) e(d      Z*dZ+dZ,dZ-dZ G d d      Z. G d de/      Z0 G d d      Z1 G d d      Z2 G d de/      Z3 G d d      Z4 G d de/      Z5 G d d       Z6 G d! d"      Z7 G d# d$e/      Z8 G d% d&      Z9 G d' d(e(      Z: G d) d*e(      Z; G d+ d,      Z< G d- d.      Z= G d/ d0e(      Z> G d1 d2      Z? G d3 d4e@      ZA G d5 d6e@      ZB G d7 d8      ZC G d9 d:      ZD G d; d<e@      ZE G d= d>eF      ZG G d? d@eH      ZI eJ eKdA            dddB   ZL eJdA      dddB   ZM G dC dDe j                        ZO G dE dFe j                        ZP G dG dHe j                        ZQ G dI dJe j                  e      ZR G dK dL      ZS G dM dNe j                        ZT G dO dPe j                        ZU G dQ dRe j                        ZV G dS dTe j                        ZW G dU dVe j                        ZX G dW dXe j                        ZY G dY dZe j                        ZZ G d[ d\e j                        Z[ G d] d^e j                        Z\ G d_ d`e j                        Z] G da dbe j                        Z^ G dc dde j                        Z_e`dek(  r e j                          yy# e$ r eZY w xY w)f    N)support)import_helper)script_helper)warnings_helper)FloatsAreIdenticalMixin	_testcapi)getargs_keywordsgetargs_keyword_onlyil   B$$HH! `? )	UCHAR_MAX	USHRT_MAXUINT_MAX	ULONG_MAXINT_MAXINT_MINLONG_MINLONG_MAXPY_SSIZE_T_MINPY_SSIZE_T_MAXSHRT_MINSHRT_MAXFLT_MINFLT_MAXDBL_MINDBL_MAXinfnanl    l         l    c                       e Zd Zd Zy)Indexc                      yNc    selfs    E/opt/python-3.12.12/usr/lib/python3.12/test/test_capi/test_getargs.py	__index__zIndex.__index__D           N__name__
__module____qualname__r&   r"   r(   r%   r   r   C       r(   r   c                       e Zd Zd Zy)IndexIntSubclassc                      yr    r"   r#   s    r%   r&   zIndexIntSubclass.__index__H   r'   r(   Nr)   r"   r(   r%   r/   r/   G   r-   r(   r/   c                       e Zd Zd Zy)BadIndexc                      yN      ?r"   r#   s    r%   r&   zBadIndex.__index__L       r(   Nr)   r"   r(   r%   r2   r2   K       r(   r2   c                       e Zd Zd Zy)	BadIndex2c                      yNTr"   r#   s    r%   r&   zBadIndex2.__index__P       r(   Nr)   r"   r(   r%   r9   r9   O       r(   r9   c                       e Zd Zd Zy)	BadIndex3c                      yr;   r"   r#   s    r%   r&   zBadIndex3.__index__T   r<   r(   Nr)   r"   r(   r%   r?   r?   S   r=   r(   r?   c                       e Zd Zd Zy)Intc                      yr    r"   r#   s    r%   __int__zInt.__int__Y   r'   r(   Nr*   r+   r,   rD   r"   r(   r%   rB   rB   X   r-   r(   rB   c                       e Zd Zd Zy)IntSubclassc                      yr    r"   r#   s    r%   rD   zIntSubclass.__int__]   r'   r(   NrE   r"   r(   r%   rG   rG   \   r-   r(   rG   c                       e Zd Zd Zy)BadIntc                      yr4   r"   r#   s    r%   rD   zBadInt.__int__a   r6   r(   NrE   r"   r(   r%   rJ   rJ   `   r7   r(   rJ   c                       e Zd Zd Zy)BadInt2c                      yr;   r"   r#   s    r%   rD   zBadInt2.__int__e   r<   r(   NrE   r"   r(   r%   rM   rM   d   r=   r(   rM   c                       e Zd Zd Zy)BadInt3c                      yr;   r"   r#   s    r%   rD   zBadInt3.__int__i   r<   r(   NrE   r"   r(   r%   rP   rP   h   r=   r(   rP   c                       e Zd Zd Zy)Floatc                      yN      @r"   r#   s    r%   	__float__zFloat.__float__n   r<   r(   Nr*   r+   r,   rW   r"   r(   r%   rS   rS   m   r=   r(   rS   c                       e Zd Zy)FloatSubclassNr*   r+   r,   r"   r(   r%   rZ   rZ   q       r(   rZ   c                       e Zd Zd Zy)FloatSubclass2c                      yrU   r"   r#   s    r%   rW   zFloatSubclass2.__float__u   r<   r(   NrX   r"   r(   r%   r^   r^   t   r=   r(   r^   c                       e Zd Zd Zy)BadFloatc                      y)Ni  r"   r#   s    r%   rW   zBadFloat.__float__y   r6   r(   NrX   r"   r(   r%   ra   ra   x   r7   r(   ra   c                       e Zd Zd Zy)	BadFloat2c                     t        d      S rU   rZ   r#   s    r%   rW   zBadFloat2.__float__}       T""r(   NrX   r"   r(   r%   rd   rd   |       #r(   rd   c                       e Zd Zd Zy)	BadFloat3c                     t        d      S rU   rf   r#   s    r%   rW   zBadFloat3.__float__   rg   r(   NrX   r"   r(   r%   rj   rj      rh   r(   rj   c                       e Zd Zd Zy)Complexc                      yN      @      ?r"   r#   s    r%   __complex__zComplex.__complex__       r(   Nr*   r+   r,   rq   r"   r(   r%   rm   rm          r(   rm   c                       e Zd Zy)ComplexSubclassNr[   r"   r(   r%   rv   rv      r\   r(   rv   c                       e Zd Zd Zy)ComplexSubclass2c                      yro   r"   r#   s    r%   rq   zComplexSubclass2.__complex__   rr   r(   Nrs   r"   r(   r%   rx   rx      rt   r(   rx   c                       e Zd Zd Zy)
BadComplexc                      y)Ng      ?r"   r#   s    r%   rq   zBadComplex.__complex__   r<   r(   Nrs   r"   r(   r%   r{   r{      r=   r(   r{   c                       e Zd Zd Zy)BadComplex2c                     t        d      S ro   rv   r#   s    r%   rq   zBadComplex2.__complex__       y))r(   Nrs   r"   r(   r%   r~   r~          *r(   r~   c                       e Zd Zd Zy)BadComplex3c                     t        d      S ro   r   r#   s    r%   rq   zBadComplex3.__complex__   r   r(   Nrs   r"   r(   r%   r   r      r   r(   r   c                       e Zd Zy)TupleSubclassNr[   r"   r(   r%   r   r      r\   r(   r   c                       e Zd Zy)DictSubclassNr[   r"   r(   r%   r   r      r\   r(   r   s	   noncontigc                   *    e Zd Zd Zd Zd Zd Zd Zy)Unsigned_TestCasec                 L   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j                  t"        |d       | j	                  d |d             | j	                  t$         |t$                     | j                  t"        |t$        dz          | j	                  d |d             | j                  t"        |t&               y # 1 sw Y   hxY w)Nr   )	getargs_bQ	@r!      *   )r   r   assertRaises	TypeErrorassertEqualr   r/   r2   assertWarnsDeprecationWarningr9   r?   rB   rG   rJ   rM   rP   OverflowErrorr   
VERY_LARGE)r$   r   s     r%   test_bzUnsigned_TestCase.test_b   s   ')Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01-B7IaL)Ii$89-IMBYr]+-J? 21s   !HH#c                 p   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j	                  t"         |d             | j	                  d |d             | j	                  t"         |t"                     | j	                  d |t"        dz                | j	                  d |d             | j	                  t"        t$        z   |t$                     y # 1 sw Y   zxY w)Nr   )	getargs_Br   r!   r   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   )r$   r   s     r%   test_BzUnsigned_TestCase.test_B   s   ')Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01IbM2IaL)Ii$89Iik23Yr]+Z/:1FG 21   !H++H5c                 p   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j	                  t"         |d             | j	                  d |d             | j	                  t"         |t"                     | j	                  d |t"        dz                | j	                  d |d             | j	                  t$        t"        z   |t$                     y # 1 sw Y   zxY w)Nr   )	getargs_Hr   r!   r   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   )r$   r   s     r%   test_HzUnsigned_TestCase.test_H   s   ')Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01IbM2IaL)Ii$89Iik23Yr]+i/:1FG! 21r   c                 p   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j	                  t"         |d             | j	                  d |d             | j	                  t"         |t"                     | j	                  d |t"        dz                | j	                  d |d             | j	                  t$        t"        z   |t$                     y # 1 sw Y   zxY w)Nr   )	getargs_Ir   r!   r   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   )r$   r   s     r%   test_IzUnsigned_TestCase.test_I   s   ')Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi019R=1IaL)9X#67Ihqj12Yr]+h.	*0EF! 21r   c                    ddl m} | j                  t        |d       | j                  t        |t	                      | j                  d |t                            | j                  t        |t                      | j                  t        |t                      | j                  d |t                            | j                  t        |t                      | j                  d |t                            | j                  t        |t                      | j                  t        |t                      | j                  d |t                            | j                  t         |d             | j                  d |d             | j                  t         |t                     | j                  d |t        dz                | j                  d |d             | j                  t         t        z   |t                      y )Nr   )	getargs_kr   r   r   r   )r   r   r   r   r   r   r/   r2   r9   r?   rB   rG   rJ   rM   rP   r   r   )r$   r   s     r%   test_kzUnsigned_TestCase.test_k	  ss   ' 	)Y5)Y8I&6&89:)Y
;)Y	<Iik23)Y6Ikm45)Y9)Y	:Igi01IbM2IaL)Ii$89Iik23Yr]+i/:1FGr(   N)r*   r+   r,   r   r   r   r   r   r"   r(   r%   r   r      s     @0H0H2G2Hr(   r   c                   $    e Zd Zd Zd Zd Zd Zy)Signed_TestCasec                 j   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j                  t"        |t$        dz
         | j	                  t$         |t$                     | j	                  t&         |t&                     | j                  t"        |t&        dz          | j	                  d |d             | j                  t"        |t(               y # 1 sw Y   wxY w)Nr   )	getargs_hr   r!   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   r   r   )r$   r   s     r%   test_hzSigned_TestCase.test_h#     ')Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01-HQJ?9X#679X#67-HQJ?Yr]+-J? 21   !H((H2c                 j   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j                  t"        |t$        dz
         | j	                  t$         |t$                     | j	                  t&         |t&                     | j                  t"        |t&        dz          | j	                  d |d             | j                  t"        |t(               y # 1 sw Y   wxY w)Nr   )	getargs_ir   r!   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   r   r   )r$   r   s     r%   test_izSigned_TestCase.test_i;  s   ')Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01-GAI>)G"45)G"45-GAI>Yr]+-J? 21r   c                 j   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j                  t"        |t$        dz
         | j	                  t$         |t$                     | j	                  t&         |t&                     | j                  t"        |t&        dz          | j	                  d |d             | j                  t"        |t(               y # 1 sw Y   wxY w)Nr   )	getargs_lr   r!   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   r   r   )r$   r   s     r%   test_lzSigned_TestCase.test_lS  r   r   c                 j   ddl m} | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j                  t"        |t$        dz
         | j	                  t$         |t$                     | j	                  t&         |t&                     | j                  t"        |t&        dz          | j	                  d |d             | j                  t"        |t(               y # 1 sw Y   wxY w)Nr   )	getargs_nr   r!   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   r   r   r   )r$   r   s     r%   test_nzSigned_TestCase.test_nk  s   ' 	)Y5Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01-N14DE>)BC>)BC-N14DEYr]+-J? 21r   N)r*   r+   r,   r   r   r   r   r"   r(   r%   r   r   "  s    @0@0@0@r(   r   c                       e Zd Zd Zd Zy)LongLong_TestCasec                    ddl m} | j                  t        |d       | j                  t        |d       | j	                  d |t                            | j	                  d |t                            | j                  t        |t                      | j                  t              5  | j	                  d |t                            d d d        | j	                  d |t                            | j                  t        |t                      | j	                  d |t                            | j                  t        |t                      | j                  t        |t                      | j	                  d |t!                            | j                  t"        |t$        dz
         | j	                  t$         |t$                     | j	                  t&         |t&                     | j                  t"        |t&        dz          | j	                  d |d             | j                  t"        |t(               y # 1 sw Y   wxY w)Nr   )	getargs_Lr   Hellor!   r   r   )r   r   r   r   r   r   r/   r2   r   r   r9   r?   rB   rG   rJ   rM   rP   r   	LLONG_MIN	LLONG_MAXr   )r$   r   s     r%   test_LzLongLong_TestCase.test_L  s   ' 	)Y5)Y8Yuw/0I&6&89:)Y
;01Q	)+ 67 2Iik23)Y6Ikm45)Y9)Y	:Igi01-IaK@Ii$89Ii$89-IaK@Yr]+-J? 21s   )!H??I	c                    ddl m} | j                  t        |d       | j                  t        |t	                      | j                  d |t                            | j                  t        |t                      | j                  t        |t                      | j                  d |t                            | j                  t        |t                      | j                  d |t                            | j                  t        |t                      | j                  t        |t                      | j                  d |t                            | j                  t         |t                     | j                  d |d             | j                  d |t        dz                | j                  d |d             | j                  t         t        z   |t                      y )Nr   )	getargs_Kr   r   r   )r   r   r   r   r   r   r/   r2   r9   r?   rB   rG   rJ   rM   rP   
ULLONG_MAXr   )r$   r   s     r%   test_KzLongLong_TestCase.test_K  s]   ')Y5)Y8I&6&89:)Y
;)Y	<Iik23)Y6Ikm45)Y9)Y	:Igi01Yz%:;IaL)Ijl34Yr]+j0)J2GHr(   N)r*   r+   r,   r   r   r"   r(   r%   r   r     s    @4Ir(   r   c                   B    e Zd Zd Zej
                  d        Zd Zd Zy)Float_TestCasec                 <   ddl m} | j                   |d      d       | j                   |d      d       | j                  t        |d       | j                   |t                     d       | j                   |t        d            d       | j                   |t        d            d       | j                  t        |t                      | j                  t              5  | j                   |t                     d       d d d        | j                   |t        d            d       | j                   |t                     d       | j                  t        |t                      t        t         t         t          t"        t"         fD ]  }| j                   ||      |        t         t$        k  rB| j                   |t$              t"               | j                   |t$               t"                t        t&        kD  r9| j)                   |t&              d	       | j)                   |t&               d
       | j)                   |d	      d	       | j)                   |d
      d
        |t*              }| j-                  ||       y # 1 sw Y   xY w)Nr   	getargs_frV            @      @              @     X@               )r   r   r   r   r   rS   rZ   r^   ra   r   r   rd   rj   r   rB   r   r   INFr   r   assertFloatsAreIdenticalNANassertNotEqual)r$   r   xrs       r%   test_fzFloat_TestCase.test_f  s   '4$/1s+)Y857+T2=#56<>##67=)Y
;01Yy{3T: 29S>2C857+T2)Y6G8WwhcTBAYq\1- CWYw/5Yx03$7W)))G*<cB)))WH*=tD%%inc:%%iot<cNAq!# 21s   $!JJc                     ddl m} | j                   |d      t               | j                   |d      t                y )Nr   r   gnGgn)r   r   r   r   )r$   r   s     r%   test_f_roundingzFloat_TestCase.test_f_rounding  s1    '=17;>2WH=r(   c                    ddl m} | j                   |d      d       | j                   |d      d       | j                  t        |d       | j                   |t                     d       | j                   |t        d            d       | j                   |t        d            d       | j                  t        |t                      | j                  t              5  | j                   |t                     d       d d d        | j                   |t        d            d       | j                   |t                     d       | j                  t        |t                      t        t         t         t          t"        t"         fD ]  }| j                   ||      |        | j                  t$        |d	t&        z         | j                  t$        |d
t&        z         | j)                   |d      d       | j)                   |d      d        |t*              }| j-                  ||       y # 1 sw Y   5xY w)Nr   )	getargs_drV   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   rS   rZ   r^   ra   r   r   rd   rj   r   rB   r   r   r   r   DBL_MAX_EXPr   r   r   )r$   r   r   r   s       r%   test_dzFloat_TestCase.test_d  s   '4$/1s+)Y857+T2=#56<>##67=)Y
;01Yy{3T: 29S>2C857+T2)Y6G8WwhcTBAYq\1- C-A{NC-BOD%%inc:%%iot<cNAq! 21s   $!H88Ic                 8   ddl m} | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |t                     d       | j                   |t	        d            d       | j                   |t        d            d       | j                  t        |t                      | j                  t              5  | j                   |t                     d       d d d        | j                   |t        d            d       | j                   |t                     d	       | j                  t        |t                      t        t         t         t          t"        t"         fD ]J  }t%        |d
      }| j                   ||      |       t%        d
|      }| j                   ||      |       L | j'                   |t%        dd
            j(                  d       | j'                   |t%        dd
            j(                  d       | j'                   |t%        d
d            j*                  d       | j'                   |t%        d
d            j*                  d       y # 1 sw Y   xY w)Nr   )	getargs_Drp   rV   r   r   y      @        y      @      ?y     X@        r5   r   r   )r   r   r   rm   rv   rx   r   r   r{   r   r   r~   r   r   rB   r   r   r   complexr   realimag)r$   r   r   cs       r%   test_DzFloat_TestCase.test_D  s   '9-y94'21v.79-y9?9#=>	J#3I#>?K)Y
=01Y{}5yA 2;y#9:IF57+W5)Y6G8WwhcTBA3AYq\1-QAYq\1-	 C
 	%%iS0A&B&G&GM%%ic0B&C&H&H$O%%iS0A&B&G&GM%%iT0B&C&H&H$O 21s   %!JJN)	r*   r+   r,   r   r   requires_IEEE_754r   r   r   r"   r(   r%   r   r     s,    "8 > >
"0Pr(   r   c                       e Zd ZdZd Zy)ParadoxzThis statement is false.c                     t         N)NotImplementedErrorr#   s    r%   __bool__zParadox.__bool__  s    !!r(   N)r*   r+   r,   __doc__r   r"   r(   r%   r   r     s
    "r(   r   c                       e Zd Zd Zy)Boolean_TestCasec                    ddl m} | j                  d |d             | j                  d |d              | j                  d |d             | j                  d |d             | j                  d |d             | j                  d |d             | j                  d |d             | j                  d |g              | j                  d |i              | j                  d |d	             | j                  d |d             | j                  d |d
             | j                  d |d             | j                  d |d             | j                  d |d             | j                  d |dg             | j                  d |ddi             | j                  d |t        j                               | j                  t        |t                      y )Nr   )	getargs_pFr   y                 r"   r   Tr5   y              ?r   r      )r   r   r   unittestTestCaser   r   r   )r$   r   s     r%   test_pzBoolean_TestCase.test_p  s   'Ie,-IdO,IaL)IcN+IbM*IbM*IbM*IbM*IbM*IdO,IaL)IcN+IbM*IcN+IdO,IqcN+Iqe,-Ih&7&789-y')Dr(   N)r*   r+   r,   r   r"   r(   r%   r   r     s    Er(   r   c                       e Zd Zd Zd Zy)Tuple_TestCasec                    ddl m}  |dd      }| j                  |d       | j                  t	        |      t
                |dgd }| j                  |d       | j                  t	        |      t
                |ddg }| j                  |d       | j                  t	        |      t
                |t        ddg       }| j                  |d       | j                  t	        |      t
                |       }| j                  |d       | j                  t	        |      t
        t	        d       f        |d	 }| j                  |d       | j                  t	        |      t
        t	        d       f       y )
Nr   )get_argsr   r   r   r   r      r   r   r   )r"   Nr"   )r   r   r   assertIstypetupler   assertIn)r$   r   rets      r%   	test_argszTuple_TestCase.test_args-  s*   &q!nf%d3i'q"6"i(d3i'Af%d3i'q!f-.f%d3i'jc:&d3i%d!45mc:&d3i%d!45r(   c                     ddl m}  |dd      }| j                  |d        G d d      }| j                  t        |d |              y )Nr   )getargs_tupler   r   r   c                       e Zd Zd Zd Zy)&Tuple_TestCase.test_tuple.<locals>.seqc                      y)Nr   r"   r#   s    r%   __len__z.Tuple_TestCase.test_tuple.<locals>.seq.__len__P  s    r(   c                     t         r   )
ValueError)r$   ns     r%   __getitem__z2Tuple_TestCase.test_tuple.<locals>.seq.__getitem__R  s      r(   N)r*   r+   r,   r	  r  r"   r(   r%   seqr  O  s    !r(   r  )r   r  r   r   r   )r$   r  r  r  s       r%   
test_tuplezTuple_TestCase.test_tupleH  sC    +Av&g&	! 	!
 	)]Asu=r(   N)r*   r+   r,   r  r  r"   r(   r%   r   r   ,  s    66>r(   r   c                   B    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zy
)Keywords_TestCasec           	         ddl m}  |dd      }| j                  |ddd       | j                  t	        |      t
                |d
ddiddd}| j                  |dddd	       | j                  t	        |      t
                |d
i t        ddd      }| j                  |ddd       | j                  t	        |      t
                |       }| j                  |i d f       | j                  t	        |      t
        t	        d       f        |d
i i }| j                  |i d f       | j                  t	        |      t
        t	        d       f       y )Nr   )
get_kwargsr   r   abr  r   )r  r   r  r  r   r"   )r   r  r   r   r   dictr   r  )r$   r  r  s      r%   test_kwargszKeywords_TestCase.test_kwargsW  s$   (1"AA./d3i&111aa 01AAA67d3i&:<aa(89:AA./d3i&lcB:&d3i$T
!342cB:&d3i$T
!34r(   c           	      B    | j                  t        ddddd      d       y )Nr   r   r   )            	   
   
r   r   r   r   r  r  r  r   r!  r"  r   r	   r#   s    r%   test_positional_argsz&Keywords_TestCase.test_positional_argsn  s#    UAy'2>+	r(   c           	      D    | j                  t        ddddd      d       y )Nr   r   r  r  r"  )arg4arg5r#  r$  r#   s    r%   test_mixed_argsz!Keywords_TestCase.test_mixed_argsu  s#    UAywRH+	r(   c           	      D    | j                  t        ddddd      d       y )Nr   r   r  r  r"  )arg1arg2arg3r'  r(  r#  r$  r#   s    r%   test_keyword_argsz#Keywords_TestCase.test_keyword_args|  s$    %aigTVW+	r(   c                 @    | j                  t        ddd      d       y )Nr   r   r"  )r+  r,  r(  )
r   r   r   r   r   r   r   r   r   r"  r$  r#   s    r%   test_optional_argsz$Keywords_TestCase.test_optional_args  s    %ab91	r(   c                     	 t        d       | j                  d       y # t        $ r%}| j                  t	        |      d       Y d }~y d }~ww xY w)Nr   )r+  !TypeError should have been raisedz1function missing required argument 'arg2' (pos 2)r	   failr   r   strr$   errs     r%   test_required_argsz$Keywords_TestCase.test_required_args  sQ    	;%(
 II9:	  	OCMO O	Os     	AA		Ac                     	 t        dddddd       | j                  d       y # t        $ r%}| j                  t	        |      d       Y d }~y d }~ww xY w)	Nr   r   r  r  r"  o   r2  z,function takes at most 5 arguments (6 given)r3  r6  s     r%   test_too_many_argsz$Keywords_TestCase.test_too_many_args  sT    	;U1Ywr#> II9:  	WSX'UVV	Ws   $ 	AAAc                     	 t        dddd       | j                  d       y # t        $ r%}| j                  t	        |      d       Y d }~y d }~ww xY w)Nr   r   r"    )r(  arg666r2  z9'arg666' is an invalid keyword argument for this functionr3  r6  s     r%   test_invalid_keywordz&Keywords_TestCase.test_invalid_keyword  sP    	;U1"C8 II9:  	dSX'bcc	ds   # 	AAAc                     	 t        di ddi | j                  d       y # t        $ r%}| j                  t	        |      d       Y d }~y d }~ww xY w)N)r   r   r  r     r"  r2  6   '' is an invalid keyword argument for this functionr3  r6  s     r%   test_surrogate_keywordz(Keywords_TestCase.test_surrogate_keyword  sQ    	;Lh^L II9:  	dSX'bcc	ds   ! 	AA

AN)r*   r+   r,   r  r%  r)  r.  r0  r8  r;  r?  rC  r"   r(   r%   r  r  V  s/    5.;;;;r(   r  c                   H    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)KeywordOnly_TestCasec                 <    | j                  t        dd      d       y )Nr   r   r   r   r   r   r
   r#   s    r%   r%  z)KeywordOnly_TestCase.test_positional_args  s     A&	r(   c                 @    | j                  t        ddd      d       y )Nr   r   r   keyword_onlyr   rH  r#   s    r%   r)  z$KeywordOnly_TestCase.test_mixed_args  s     AA6	r(   c                 @    | j                  t        ddd      d       y )Nr   r   r   )requiredoptionalrK  r   rH  r#   s    r%   r.  z&KeywordOnly_TestCase.test_keyword_args  s     !aaH	r(   c                 x    | j                  t        dd      d       | j                  t        dd      d       y )Nr   r   )rM  rN  rG  r   )rM  rK  r   r   r   rH  r#   s    r%   r0  z'KeywordOnly_TestCase.test_optional_args  s:     !a8	 	 !!<	r(   c                 N   | j                  t        d      d       | j                  t        d      d       | j                  t        d      5  t        d       d d d        | j                  t        d      5  t        d       d d d        y # 1 sw Y   5xY w# 1 sw Y   y xY w)	Nr   r   r   r   )rM  z7function missing required argument 'required' \(pos 1\)r   )rN  r   rJ  )r   r
   assertRaisesRegexr   r#   s    r%   r8  z'KeywordOnly_TestCase.test_required_args  s     #	 	 !,	
 ##IFH !,H ##IFH a0H H	H HH Hs   B9BBB$c                     | j                  t        d      5  t        ddd       d d d        | j                  t        d      5  t        dddd       d d d        y # 1 sw Y   8xY w# 1 sw Y   y xY w)Nz9function takes at most 2 positional arguments \(3 given\)r   r   r   z.function takes at most 3 arguments \(4 given\)r  rJ  rS  r   r
   r#   s    r%   r;  z'KeywordOnly_TestCase.test_too_many_args  sm    ##IHJ Aq)J ##I=? Aqq9? ?	J J? ?s   AA(A%(A1c                 v    | j                  t        d      5  t        ddd       d d d        y # 1 sw Y   y xY w)Nz:'monster' is an invalid keyword argument for this functionr   r   r=  )monsterrU  r#   s    r%   r?  z)KeywordOnly_TestCase.test_invalid_keyword  s5    ##IHJ As3J J Js   /8c                 t    | j                  t        d      5  t        di ddi d d d        y # 1 sw Y   y xY w)NrB  rA  r"  r   rU  r#   s    r%   rC  z+KeywordOnly_TestCase.test_surrogate_keyword  s8    ##IGI 8(B8I I Is   .7c                     G d dt               }| j                  t        d      5  t        di  |d      di d d d        | j                  t        d      5  t        di  |d      di d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY w)	Nc                       e Zd Zd Zd Zy)<KeywordOnly_TestCase.test_weird_str_subclass.<locals>.BadStrc                      yr;   r"   r$   others     r%   __eq__zCKeywordOnly_TestCase.test_weird_str_subclass.<locals>.BadStr.__eq__  s    r(   c                 2    t         j                  |       dz  S )Nr   r5  __hash__r#   s    r%   rb  zEKeywordOnly_TestCase.test_weird_str_subclass.<locals>.BadStr.__hash__  s    ||D)A--r(   Nr*   r+   r,   r_  rb  r"   r(   r%   BadStrr[    s    .r(   rd  *invalid keyword argument for this functionrK  r   rW  r=  r   r5  rS  r   r
   r$   rd  s     r%   test_weird_str_subclassz,KeywordOnly_TestCase.test_weird_str_subclass  s    	.S 	. ##I8: E&*@!)DE: ##I8: B&*;S)AB: :: :: :   A5B5A>B
c                     G d dt               }| j                  t        d      5  t        di  |d      di d d d        | j                  t        d      5  t        di  |d      di d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY w)	Nc                       e Zd Zd Zd Zy)=KeywordOnly_TestCase.test_weird_str_subclass2.<locals>.BadStrc                      y)NFr"   r]  s     r%   r_  zDKeywordOnly_TestCase.test_weird_str_subclass2.<locals>.BadStr.__eq__  s    r(   c                 ,    t         j                  |       S r   ra  r#   s    r%   rb  zFKeywordOnly_TestCase.test_weird_str_subclass2.<locals>.BadStr.__hash__  s    ||D))r(   Nrc  r"   r(   r%   rd  rl    s    *r(   rd  re  rK  r   rW  r=  r   rf  rg  s     r%   test_weird_str_subclass2z-KeywordOnly_TestCase.test_weird_str_subclass2  s    	*S 	*
 ##I8: E&*@!)DE: ##I8: B&*;S)AB: :: :: :ri  N)r*   r+   r,   r%  r)  r.  r0  r8  r;  r?  rC  rh  ro  r"   r(   r%   rE  rE    s6    	1$:49
CCr(   rE  c                   6    e Zd ZddlmZ d Zd Zd Zd Z	d Z
y)	"PositionalOnlyAndKeywords_TestCaser   )$getargs_positional_only_and_keywordsc                 J    | j                  | j                  ddd      d       y )Nr   r   r   r   r   getargsr#   s    r%   r%  z7PositionalOnlyAndKeywords_TestCase.test_positional_args  s    aA.	:r(   c                 L    | j                  | j                  ddd      d       y )Nr   r   r   keywordr   rt  r#   s    r%   r)  z2PositionalOnlyAndKeywords_TestCase.test_mixed_args  s!    aA6	Br(   c                     | j                  | j                  dd      d       | j                  | j                  dd      d       y )Nr   r   rG  r   rw  rP  rt  r#   s    r%   r0  z5PositionalOnlyAndKeywords_TestCase.test_optional_args  s:    a+Z8a3Z@r(   c                 6   | j                  | j                  d      d       | j                  t        d      5  | j                          d d d        | j                  t        d      5  | j                  d       d d d        y # 1 sw Y   ;xY w# 1 sw Y   y xY w)Nr   rR  9function takes at least 1 positional argument \(0 given\)r   rw  )r   ru  rS  r   r#   s    r%   r8  z5PositionalOnlyAndKeywords_TestCase.test_required_args   s    a+6##IHJLLNJ ##IHJLLL#J J	J JJ Js   B'BBBc                     | j                  t        d      5   | j                  di ddi d d d        y # 1 sw Y   y xY w)Nz3'' is an invalid keyword argument for this functionr   r=  r   )rS  r   ru  r#   s    r%   test_empty_keywordz5PositionalOnlyAndKeywords_TestCase.test_empty_keyword+  s>    ##IACDLL+"c+C C Cs   5>N)r*   r+   r,   r   rr  ru  r%  r)  r0  r8  r}  r"   r(   r%   rq  rq    s     I;CA
	$,r(   rq  c                   *    e Zd Zd Zd Zd Zd Zd Zy)Bytes_TestCasec                 z   ddl m} | j                  t        |d       | j	                   |d      d       | j	                   |t        d            d       | j                  t        |t        d             | j                  t        |d       | j                  t        |d       | j                  t        |d        y )Nr   )	getargs_cs   abc   aa   s)r   r  r   r   r   	bytearray
memoryview)r$   r  s     r%   test_czBytes_TestCase.test_c2  s    ')Y74"-9T?3R8)Y
40@A)Y4)Y3)Y5r(   c                 J   ddl m} | j                  t        |d       | j	                   |d      d       | j                  t
        |d       | j                  t        |t        d             | j                  t        |t        d             | j                  t        |d        y )Nr   )	getargs_y   abcé   bytes   nul: 	   bytearray
   memoryview)r   r  r   r   r   r  r  r  )r$   r  s     r%   test_yzBytes_TestCase.test_y<  s~    ')Y	:8,h7*i;)Y	,0GH)Y
=0IJ)Y5r(   c                    ddl m} | j                  t        |d       | j	                   |d      d       | j	                   |d      d       | j	                   |t        d            d       | j	                   |t        d            d       | j                  t        |d        | j                  t        |t               | j                  t        |t               y )Nr   )getargs_y_starr  r  r  r  r  )
r   r  r   r   r   r  r  BufferErrorNONCONTIG_WRITABLENONCONTIG_READONLY)r$   r  s     r%   test_y_starzBytes_TestCase.test_y_starE  s    ,)^Y?18<	2I>	,(?@,O
=(ABMR)^T:+~7IJ+~7IJr(   c                    ddl m} | j                  t        |d       | j	                   |d      d       | j	                   |d      d       | j                  t        |t        d             | j                  t        |t        d             | j                  t        |d        | j                  t        |t               | j                  t        |t               y )Nr   )getargs_y_hashr  r  r  r  r  )	r   r  r   r   r   r  r  r  r  )r$   r  s     r%   test_y_hashzBytes_TestCase.test_y_hashP  s    ,)^Y?18<	2I>)^Y|5LM)^Z5NO)^T:)^5GH)^5GHr(   c                 ~   ddl m} | j                  t        |d       | j                  t        |d       | j                  t        |d       | j                  t        |t	        d             t        d      }| j                   ||      d       | j                  |t        d             t        d      }| j                   |t	        |            d	       | j                  |t        d	             | j                  t        |d        | j                  t        |t               | j                  t        |t               y )
Nr   )getargs_w_starr  r  r  r  s	   [ytearra]r  s
   [emoryvie])	r   r  r   r   r  r  r   r  r  )r$   r  bufs      r%   test_w_starzBytes_TestCase.test_w_star\  s    ,)^Y?)^X>)^Y?)^Z5IJ%,l;i56&
38-Hi67)^T:)^5GH)^5GHr(   N)r*   r+   r,   r  r  r  r  r  r"   r(   r%   r  r  1  s    66	K
IIr(   r  c                      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 ej                          d        Z ej                          d        Z ej                          d        Z ej                          d        Zd Zy)String_TestCasec                    ddl m} | j                  t        |d       | j	                   |d      d       | j	                   |d      d       | j	                   |d      d	       | j                  t        |d
       | j                  t        |t        d
             | j                  t        |t        d
             | j                  t        |d       | j                  t        |d        y )Nr   )	getargs_Cabcr  r  u   €i   u   🐍i r  )r   r  r   r   r   r  r  )r$   r  s     r%   test_CzString_TestCase.test_Co  s    ')Y63,8,f5<0':)Y5)Y	$@)Y
40@A)Y3)Y5r(   c                 J   ddl m} | j                   |d      d       | j                  t        |d       | j                  t
        |d       | j                  t
        |t        d             | j                  t
        |t        d             | j                  t
        |d        y )	Nr   )	getargs_sr     abcénul: r  r  r  )r   r  r   r   r  r   r  r  )r$   r  s     r%   test_szString_TestCase.test_s{  s~    '9-~>*i:)Y9)Y	,0GH)Y
=0IJ)Y5r(   c                    ddl m} | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |t        d            d       | j                   |t	        d	            d	       | j                  t        |d        | j                  t        |t               | j                  t        |t               y )
Nr   )getargs_s_starr  r  r  r  r  r  r  )
r   r  r   r  r  r   r   r  r  r  )r$   r  s     r%   test_s_starzString_TestCase.test_s_star  s    ,	2NC19=18<	,(?@,O
=(ABMR)^T:+~7IJ+~7IJr(   c                    ddl m} | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                  t        |t        d             | j                  t        |t        d	             | j                  t        |d        | j                  t        |t               | j                  t        |t               y )
Nr   )getargs_s_hashr  r  r  r  r  r  r  )	r   r  r   r   r   r  r  r  r  )r$   r  s     r%   test_s_hashzString_TestCase.test_s_hash  s    ,	2NC19=18<)^Y|5LM)^Z5NO)^T:)^5GH)^5GHr(   c                    ddl m} ddl m} t        ddg      }| j	                  t
        ||d       | j	                  t
        ||d       | j	                  t
        ||d       | j	                  t
        ||d	       | j	                  t
        ||d       | j	                  t
        ||d       |j                  d
       y )Nr   )getargs_s_hash_int)getargs_s_hash_int2r   r   r  r   )r   )r  r   )r   r  r  r  r   SystemErrorappend)r$   r  r  r  s       r%   test_s_hash_intzString_TestCase.test_s_hash_int  s    01A+'93F+'93"E+'93%H+':CJ+':C2F+':C5I

1r(   c                 J   ddl m} | j                   |d      d       | j                  t        |d       | j                  t
        |d       | j                  t
        |t        d             | j                  t
        |t        d             | j                   |d              y )	Nr   )	getargs_zr  r  r  r  r  r  )	r   r  r   r   r  r   r  r  assertIsNone)r$   r  s     r%   test_zzString_TestCase.test_z  s~    '9-~>*i:)Y9)Y	,0GH)Y
=0IJ)D/*r(   c                    ddl m} | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                   |t        d            d       | j                   |t	        d	            d	       | j                   |d              | j                  t        |t               | j                  t        |t               y )
Nr   )getargs_z_starr  r  r  r  r  r  r  )
r   r  r   r  r  r  r   r  r  r  )r$   r  s     r%   test_z_starzString_TestCase.test_z_star  s    ,	2NC19=18<	,(?@,O
=(ABMR../+~7IJ+~7IJr(   c                    ddl m} | j                   |d      d       | j                   |d      d       | j                   |d      d       | j                  t        |t        d             | j                  t        |t        d	             | j                   |d              | j                  t        |t               | j                  t        |t               y )
Nr   )getargs_z_hashr  r  r  r  r  r  r  )
r   r  r   r   r   r  r  r  r  r  )r$   r  s     r%   test_z_hashzString_TestCase.test_z_hash  s    ,	2NC19=18<)^Y|5LM)^Z5NO../)^5GH)^5GHr(   c                    ddl m} | j                   |d      d       | j                   |dd      d       | j                  t        |dd       | j                  t
        |dd       | j                  t        |d	d       | j                  t        |t        d
      d       | j                  t        |t        d      d       | j                  t        |d d       | j                  t        |dd       y )Nr   )
getargs_esr  r  latin1   abcasciispamr  r  r  r  )	r   r  r   r   UnicodeEncodeErrorLookupErrorr   r  r  )r$   r  s     r%   test_eszString_TestCase.test_es  s    (I.?Ix8*E,j)WM+z9fE)Z8D)Z<1H(S)ZM1JHU)Zx@)Z8Dr(   c                 \   ddl m} | j                   |d      d       | j                   |dd      d       | j                  t        |dd       | j                  t
        |dd       | j                   |d	d      d	       | j                   |t        d
      d      d
       | j                  t        |t        d      d       | j                  t        |d d       | j                  t        |dd       | j                  t        |dd       | j                  t        |t        d      d       y )Nr   )
getargs_etr  r  r  r  r  r  r  r  r  r  r  )	r   r  r   r   r  r  r  r   r  )r$   r  s     r%   test_etzString_TestCase.test_et  s    (I.?Ix8*E,j)WM+z9fEHh7BIl$;XFU)ZM1JHU)Zx@)Z8D)ZHE)Z91ExPr(   c                    ddl m} | j                   |d      d       | j                   |dd      d       | j                  t        |dd       | j                  t
        |dd       | j                  t        |d	d       | j                  t        |t        d
      d       | j                  t        |t        d      d       | j                  t        |d d       | j                   |dd      d       t        d      }| j                   |dd|      d       | j                  |t        d             t        d      }| j                   |dd|      d       | j                  |t        d             t        d      }| j                  t        |dd|       | j                  |t        d             t               }| j                  t        |dd|       y )Nr   )getargs_es_hashr  r  r  r  r  r  r  r  r  r  r     xxxxxxxx   abc xxx   xxxxx   abc    xxxx)
r   r  r   r   r  r  r   r  r  r  )r$   r  r  s      r%   test_es_hashzString_TestCase.test_es_hash  s   -3^DH=zJ,oy'R+	6J)_hI)_i6MxX)_j6OQYZ)_dHE8<iHHcBJOi(9:;HcBJOi78*oy(CPi/0k*oy(CPr(   c                 &   ddl m} | j                   |d      d       | j                   |dd      d       | j                  t        |dd       | j                  t
        |dd       | j                   |d	d      d	       | j                   |t        d
      d      d
       | j                  t        |t        d      d       | j                  t        |d d       | j                   |dd      d       | j                   |dd      d       | j                   |t        d      d      d       t        d      }| j                   |dd|      d       | j                  |t        d             t        d      }| j                   |dd|      d       | j                  |t        d             t        d      }| j                  t        |dd|       | j                  |t        d             t               }| j                  t        |dd|       y )Nr   )getargs_et_hashr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )
r   r  r   r   r  r  r  r   r  r  )r$   r  r  s      r%   test_et_hashzString_TestCase.test_et_hash  s   -3^DH=zJ,oy'R+	6J8<hG<)@(K\Z)_j6OQYZ)_dHE8<iHH=yI9)=xH)THcBJOi(9:;HcBJOi78*oy(CPi/0k*oy(CPr(   c                 D   ddl m} | j                  t              5  | j	                   |d      d       d d d        | j                  t              5  | j                  t        |d       d d d        | j                  t              5  | j                  t        |d       d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                  t        |d        d d d        y # 1 sw Y   &xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   pxY w# 1 sw Y   y xY w)Nr   )	getargs_ur  r  r  r  r  )
r   r  r   r   r   r   r  r   r  r  )r$   r  s     r%   test_uzString_TestCase.test_u  s%   '01Yy19= 201j)X> 201iH= 201iIl4KL 201iJ}4MN 201iD9 21 211111111111G   EE&E2<!E>:!F
8FE#&E/2E;>F
FFc                 F   ddl m} | j                  t              5  | j	                   |d      d       d d d        | j                  t              5  | j	                   |d      d       d d d        | j                  t              5  | j                  t        |d       d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                  t        |d        d d d        y # 1 sw Y   'xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   pxY w# 1 sw Y   y xY w)Nr   )getargs_u_hashr  r  r  r  r  )	r   r  r   r   r   r   r   r  r  )r$   r  s     r%   test_u_hashzString_TestCase.test_u_hash(  s(   ,01^I6	B 201^H5x@ 201iB 201i<9PQ 201iM9RS 201i> 21 211111111111G   EE'E3=!E?;!F9FE$'E03E<?FFF c                 D   ddl m} | j                  t              5  | j	                   |d      d       d d d        | j                  t              5  | j                  t        |d       d d d        | j                  t              5  | j                  t        |d       d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                   |d              d d d        y # 1 sw Y   &xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   pxY w# 1 sw Y   y xY w)Nr   )	getargs_Zr  r  r  r  r  )r   r  r   r   r   r   r  r   r  r  r  )r$   r  s     r%   test_ZzString_TestCase.test_Z8  s%   '01Yy19= 201j)X> 201iH= 201iIl4KL 201iJ}4MN 201io. 21 211111111111r  c                 F   ddl m} | j                  t              5  | j	                   |d      d       d d d        | j                  t              5  | j	                   |d      d       d d d        | j                  t              5  | j                  t        |d       d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                  t        |t        d             d d d        | j                  t              5  | j                   |d              d d d        y # 1 sw Y   'xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   pxY w# 1 sw Y   y xY w)Nr   )getargs_Z_hashr  r  r  r  r  )
r   r  r   r   r   r   r   r  r  r  )r$   r  s     r%   test_Z_hashzString_TestCase.test_Z_hashH  s)   ,01^I6	B 201^H5x@ 201iB 201i<9PQ 201iM9RS 201nT23 21 211111111111r  c                 @    ddl m} | j                  t        |dd       y )Nr   )gh_99240_clear_argsr  z b)r   r  r   r   )r$   r  s     r%   test_gh_99240_clear_argsz(String_TestCase.test_gh_99240_clear_argsX  s    1)%8#uEr(   N)r*   r+   r,   r  r  r  r  r  r  r  r  r  r  r  r  r   requires_legacy_unicode_capir  r  r  r  r  r"   r(   r%   r  r  n  s    
66	K
I"+	K
I
EQQ0Q4 *W))+: ,: *W))+? ,? *W))+/ ,/ *W))+4 ,4Fr(   r  c                       e Zd Zd Zd Zd Zy)Object_TestCasec                     ddl m} d}| j                   ||      |       | j                  t        |t        d             | j                  t        |d       | j                  t        |d        | j                  t        |t        |             y )Nr   )	getargs_Sr  r  r5  )r   r  r   r   r   r  r  )r$   r  objs      r%   test_SzObject_TestCase.test_S^  sm    'inc*)Y	,0GH)Y6)Y5)Y
3@r(   c                     ddl m} t        d      }| j                   ||      |       | j	                  t
        |d       | j	                  t
        |d       | j	                  t
        |d        | j	                  t
        |t        |             y )Nr   )	getargs_Yr  r  r5  )r   r  r  r   r   r   r  )r$   r  r  s      r%   test_YzObject_TestCase.test_Yg  sm    '%inc*)Y9)Y6)Y5)Y
3@r(   c                     ddl m} d}| j                   ||      |       | j                  t        |d       | j                  t        |t        d             | j                  t        |d        y )Nr   )	getargs_Ur5  r  r  )r   r  r   r   r   r  )r$   r  r  s      r%   test_UzObject_TestCase.test_Up  sW    'inc*)Y9)Y	,0GH)Y5r(   N)r*   r+   r,   r  r  r  r"   r(   r%   r  r  ]  s    AA6r(   r  c                       e Zd Zd Zy)Test6012c                 P    | j                  t        j                  dd      d       y )Nr   Worldr   )r   r   
argparsingr#   s    r%   testzTest6012.test{  s    --gw?Cr(   N)r*   r+   r,   r  r"   r(   r%   r  r  z  s    Dr(   r  c                   D    e Zd Z ej                  e      d        Zd Zy)SkipitemTest)categoryc                    d}d}ddi}ddg}t        dd      D ]y  }t        |      }|dv r|d	z   }	 t        j                  ||||       d
}d|z   }	 t        j                  ||||       d
}dj                  ||||      }| j                  |||       { y# t        $ r}	d}
t        |	      |
k(  }Y d}	~	hd}	~	wt        $ r d
}Y xw xY w# t        $ r)}	dj                  |      }
t        |	      |
k(  }Y d}	~	d}	~	ww xY w)aB  
        If this test failed, you probably added a new "format unit"
        in Python/getargs.c, but neglected to update our poor friend
        skipitem() in the same file.  (If so, shame on you!)

        With a few exceptions**, this function brute-force tests all
        printable ASCII*** characters (32 to 126 inclusive) as format units,
        checking to see that PyArg_ParseTupleAndKeywords() return consistent
        errors both when the unit is attempted to be used and when it is
        skipped.  If the format unit doesn't exist, we'll get one of two
        specific error messages (one for used, one for skipped); if it does
        exist we *won't* get that error--we'll get either no error or some
        other error.  If we get the specific "does not exist" error for one
        test and not for the other, there's a mismatch, and the test fails.

           ** Some format units have special funny semantics and it would
              be difficult to accommodate them here.  Since these are all
              well-established and properly skipped in skipitem() we can
              get away with not testing them--this test is really intended
              to catch *new* format units.

          *** Python C source files must be ASCII.  Therefore it's impossible
              to have non-ASCII format units.

        r"   r   r  r   r         z()e|$iFz(argument 1 (impossible<bad format char>)N|z!impossible<bad format char>: '{}'ztest_skipitem_parity: detected mismatch between convertsimple and skipitem for format unit '{}' ({}), not skipped {}, skipped {})	rangechrr   parse_tuple_and_keywordsr  r5  r   formatr   )r$   empty_tupletuple_1dict_bkeywordsr   r   r  when_not_skippeder  optional_formatwhen_skippedmessages                 r%   test_skipitemzSkipitemTest.test_skipitem  s3   6 a:r3AAA
 G| WF)227FH&#(  "FlO-22;#X/$
HHNq,(8I:  MM,(8'BG    1>$'FaK  )#( )  -7>>vF #A!-s5   BC	CB44CC	C:C55C:c           
         t         j                  }d}d}ddi}ddg}d}t        j                  D ]k  }dD ]d  }||z   }	| j	                  |	      5  d	|	z   d
z   }
|	|v r ||||
|       n*| j                  t        d      5   ||||
|       d d d        d d d        f m t        t        t        dd            D ]d  }d|z   }	d	|	z   d
z   }
| j	                  |	      5  |dv r ||||
|       n*| j                  t        d      5   ||||
|       d d d        d d d        f y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   -xY w# 1 sw Y   xY w)Nr"   r  r  r   r  )zs#zs*zz#zz*zy#zy*zw#zw*z#*)r  r  r   zimpossible<bad format char>r     r  st)
r   r  stringascii_letterssubTestrS  r  mapr  r  )r$   parser  r  r  r	  	supportedr   c2fr  s              r%   test_skipitem_with_suffixz&SkipitemTest.test_skipitem_with_suffix  s[   22a:D	%%AF\\\+&)AgmOI~k6?HM!33K$AC!+vQC ,+  & S%C.)AaA!AgmOQ'9+vI// =?k6?HM?	 (' *	C C ,+ ? ?	 ('sH   /D+=D		D+'E D8ED($D++D58E=EE	N)r*   r+   r,   r   ignore_warningsr   r  r  r"   r(   r%   r  r    s0     %_$$.@ABC BBCHNr(   r  c                   $    e Zd Zd Zd Zd Zd Zy)ParseTupleAndKeywords_Testc           	      N   | j                  t        t        j                  di dg        | j                  t        t        j                  di dd       | j                  t        t        j                  di ddgdz         | j                  t        t        j                  di ddg       y )Nr"   r   r   )r   r   r   r  r  r#   s    r%   test_parse_tuple_and_keywordsz8ParseTupleAndKeywords_Test.test_parse_tuple_and_keywords  s    )Y%G%Gb"b	**i&H&Hb"b	**i&H&Hb"rdRi	1*i&H&Hb"rd	,r(   c           	         t         j                  }| j                   |dddiddg      d       | j                   |di ddg      t        f       | j                   |di ddd	g      d       | j                   |dd	d
iddd	g      d       | j                   |ddd
dddd	g      d       | j                   |dd	d
iddd	g      t        d
f       | j	                  t
        d      5   |di ddg       d d d        | j	                  t
        d      5   |dd	diddg       d d d        | j	                  t
        d      5   |ddd
iddd	g       d d d        y # 1 sw Y   exY w# 1 sw Y   DxY w# 1 sw Y   y xY w)Nr"   r  r   Or   |Or   OOr  r   r  |OOz&function missing required argument 'a'z"'b' is an invalid keyword argumentz>argument for function given by name \('a'\) and position \(1\)zO|O)r   r  r   NULLrS  r   r$   r  s     r%   
test_basicz%ParseTupleAndKeywords_Test.test_basic  s   22rC8S3%8$?r2tcU3dW=vr4#s<fEtc1Xtc3Z@&Ir#3TC:FOrC8US#J?$K##I8:"b#u%: ##I46"sAhse,6 ##I&( $a%#s4( (: :6 6( (s$   'EE$?E0E!$E-0E9c           	      V   | j                  t        t        j                  di ddg       | j                  t        t        j                  di dddg       | j                  t        t        j                  dddid	dg       | j                  t        t        j                  ddd
ddddg       | j                  t        t        j                  dddiddg       | j                  t        t        j                  ddd
ddddg       | j                  t        t        j                  di dddg       | j                  t        t        j                  di ddg       | j                  t        t        j                  di ddg       | j                  t        t        j                  di dddg       y )Nr   z||Or  r   z|O|Or  r"   r   z$$Or   r  z$O$Oz$|Oz$O|Or#  r%  z|$Or   )r   r  r   r  r#   s    r%   test_bad_usez'ParseTupleAndKeywords_Test.test_bad_use	  s    	+y'I'IEC5	2+y'I'I "fsCj	:+y'I'IsAhu	6+y'I'IAA.c
	D+y'I'IsAhu	6+y'I'IAA.c
	D+y'I'ID3*	6+y'I'IEC5	2+y'I'Ib%"	/+y'I'Ib%#r	4r(   c           	      &   t         j                  }| j                   |di dg d      d       | j                   |dddidg d      d       | j                  t        d      5   |dddidg d       d d d        | j                   |di d	g d      d
t
        t
        f       | j                  t        d      5   |di d	g d       d d d        | j                   |dddidg d      d       | j                  t        d      5   |dddidg d       d d d        | j                   |di dg d      d
t
        t
        f       | j                  t        d      5   |di dg d       d d d        | j                  t        d      5   |di dg d       d d d        | j                  t        d      5   |di d	g d       d d d        y # 1 sw Y   XxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   hxY w# 1 sw Y   y xY w)Nr   OOO)r   r   r  r   r  r   z:function takes at least 2 positional arguments \(1 given\)r   zO|OOr   r{  r"   zOO$Oz9function takes exactly 2 positional arguments \(1 given\)zO|O$OzEmpty parameter name after \$zO|$OOzEmpty keyword)r   r  r   )r   r  r   rS  r   r&  r  r'  s     r%   test_positional_onlyz/ParseTupleAndKeywords_Test.test_positional_only!  s   22y"e]CYOvQxF	R##ILN$a%7N 	tR?T4	*##IKM"b&-0M 	vQxG"	$##IKM$a&-8M 	tR-@T4	*##IKM"b'=1M ##K1QR$G]3 S##KA$FM2 BA)N N
M M
M M
M M SRAAsH   #G	9GG#G/G;2H	GG #G,/G8;HHN)r*   r+   r,   r   r(  r*  r-  r"   r(   r%   r  r    s    	,5*403r(   r  c                       e Zd Z e       j	                  d  ee      D               d Z ej                  e
du d      d        Zy)Test_testcapic              #      K   | ]8  }|j                  d       r%|j                  d      r|t        t        |      f : yw)test__codeN)
startswithendswithgetattrr   ).0names     r%   	<genexpr>zTest_testcapi.<genexpr>?  s<      L .w/DMM'4J 79d34 .s   >A c           	      f   t         j                  }| j                   |di ddg      d       | j                   |di dg d      d        |di d	dg       | j                  t        d
      5   |di ddg       d d d        | j                  t        d      5   |di ddg       d d d        | j                  t        d      5   |di ddg       d d d        | j                  t        d      5   |di ddg       d d d        dD ]c  }| j                  t              5   |di d|z   dz   dg       d d d        | j                  t        d      5   |di d|z   dz   dg       d d d        e y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   mxY w# 1 sw Y   xY w)N)r   z(OOO)r  r   )r   r   r   zO(OO)Or  )r   r   r   r   z(iii)z.argument 1 must be sequence of length 2, not 3z(ii)z.argument 1 must be sequence of length 2, not 1)r   z+argument 1 must be 2-item sequence, not intr   z-argument 1 must be 2-item sequence, not bytes)s   ab)esetzes#zet#))r  ()z.argument 1 must be sequence of length 1, not 0)r"   )r   r  r   rS  r   r   r  )r$   r  r  s      r%   test_nested_tuplezTest_testcapi.test_nested_tupleC  s   22|R3%@)L~r8_M%	'lB#/##I@B,FSE2B ##I@B'2vu-B ##I=?$FSE*? ##I?A(B.A *A"";/iS1Ws]SE: 0''	DFeRq36F F *B BB B? ?A A
 0/F FsH   ,E+E7F-FFF'+E47F FFF$	'F0	Nzneeds _testinternalcapic                 \    t        j                  dd      \  }}}| j                  |d       y )Nz-caa  if True:
            from test import support
            script = '''if True:
                import _testinternalcapi
                _testinternalcapi.gh_119213_getargs(spam='eggs')
                '''
            config = dict(
                allow_fork=False,
                allow_exec=False,
                allow_threads=True,
                allow_daemon_threads=False,
                use_main_obmalloc=False,
                gil=2,
                check_multi_interp_extensions=True,
            )
            rc = support.run_in_subinterp_with_config(script, **config)
            assert rc == 0

            # The crash is different if the interpreter was not destroyed first.
            #interpid = _testinternalcapi.create_interpreter()
            #rc = _testinternalcapi.exec_interpreter(interpid, script)
            #assert rc == 0
            r   )r   assert_python_okr   )r$   rcoutr7  s       r%   test_gh_119213zTest_testcapi.test_gh_119213_  s1    $55d = C. 	Qr(   )r*   r+   r,   localsupdatedirr   r>  r   skipIf_testinternalcapirC  r"   r(   r%   r/  r/  >  sR    
HOO L #IL L78 X__&$.0IJ  K r(   r/  __main__)br   mathr  sysr  r   test.supportr   r   r   test.support.testcaser   import_moduler   r	   r
   rH  ImportErrorr&  LARGEr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
float_infomax_expr   floatr   r   r   r   r   r   intr/   r2   r9   r?   rB   rG   rJ   rM   rP   rS   rZ   r^   ra   rd   rj   rm   r   rv   rx   r{   r~   r   r   r   r  r   r  r  r  r  r   r   r   r   r   r   r   r   r  rE  rq  r  r  r  r  r  r  r/  r*   mainr"   r(   r%   <module>rV     sc      
  & & ( 9'M''4	 <D 	'
< < < < < nn$$ElEl 		
 s    
 #   c 
 	E 	U  # ## #
 	g 	w  * **' *
	E 		4 	  	, 782> -dd3 zH)) zHx`@h'' `@F0I)) 0IfRPX&&(? RPj" "
Ex(( E4(>X&& (>TU;)) U;n`C8,, `CF,):): ,B:IX&& :IzlFh'' lF^6h'' 6:Dx   D
eN8$$ eNPT3!2!2 T3n: H%% : z zHMMO W+  s   
L5 5M ?M 