
    F\h                     f    S SK JrJr   " S S5      r " S S5      r " S S5      r " S S	\5      rg
)    )copysignisnanc                   d    \ rS rSrSS jrSS jrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSrg)ExtraAssertions   Nc                 x    [        X5      (       a  g U< SU< 3nU R                  U R                  X45      5        g )Nz is not a subclass of 
issubclassfail_formatMessageselfcls
superclassmsgstandardMsgs        ,/usr/lib/python3.13/test/support/testcase.pyassertIsSubclass ExtraAssertions.assertIsSubclass   s8    c&&5j^D		$%%c78    c                 x    [        X5      (       d  g U< SU< 3nU R                  U R                  X45      5        g )Nz is a subclass of r	   r   s        r   assertNotIsSubclass#ExtraAssertions.assertNotIsSubclass   s8    #**1*@		$%%c78r   c                 Z   [        X5      (       d  [        U[        R                  5      (       a  SUR                  < SU< 3nOF[        U[
        5      (       a  SUR                  < SU< 3nO[        U5      R                  < SU< 3nU R                  U R                  X45      5        g g )Nmodule z has no attribute type object z object has no attribute hasattr
isinstancetypes
ModuleType__name__typer   r   r   objnamer   r   s        r   assertHasAttrExtraAssertions.assertHasAttr   s    s!!#u//00 ''77I$RC&& ,S\\,<<NthW!%c!3!3 66OPTxXIId))#;< "r   c                 Z   [        X5      (       a  [        U[        R                  5      (       a  SUR                  < SU< 3nOF[        U[
        5      (       a  SUR                  < SU< 3nO[        U5      R                  < SU< 3nU R                  U R                  X45      5        g g )Nr   z has unexpected attribute r   z! object has unexpected attribute r   r$   s        r   assertNotHasAttr ExtraAssertions.assertNotHasAttr   s    3#u//00 ''77QRVQYZC&& ,S\\,<<VW[V^_!%c!3!3 66WX\W_`IId))#;< r   c                     UR                  U5      (       a  g U< SU< 3nU R                  U R                  X45      5        g )Nz doesn't start with 
startswithr   r   )r   sprefixr   r   s        r   assertStartsWith ExtraAssertions.assertStartsWith&   s<    <<1&<		$%%c78r   c                     UR                  U5      (       d  g U R                  U R                  X1< SU< 35      5        g )Nz starts with r-   )r   r/   r0   r   s       r   assertNotStartsWith#ExtraAssertions.assertNotStartsWith,   s6    ||F##		$%%cU-z+JKLr   c                     UR                  U5      (       a  g U< SU< 3nU R                  U R                  X45      5        g )Nz doesn't end with endswithr   r   )r   r/   suffixr   r   s        r   assertEndsWithExtraAssertions.assertEndsWith1   s<    ::f/z:		$%%c78r   c                     UR                  U5      (       d  g U R                  U R                  X1< SU< 35      5        g )Nz ends with r7   )r   r/   r9   r   s       r   assertNotEndsWith!ExtraAssertions.assertNotEndsWith7   s6    zz&!!		$%%cU+fZ+HIJr    )N)r"   
__module____qualname____firstlineno__r   r   r'   r*   r1   r4   r:   r=   __static_attributes__r?   r   r   r   r      s,    99==9M
9Kr   r   c                       \ rS rSrS rSrg)ExceptionIsLikeMixin=   c                 r   Uc  Uc  gUc  U R                  SU 35        Uc  U R                  SU< S35        [        U[        5      (       dS  U R                  UR                  UR                  5        U R                  UR
                  S   UR
                  S   5        gU R                  UR                  UR                  5        U R                  [        UR                  5      [        UR                  5      5        [        UR                  UR                  5       H  u  p4U R                  X45        M     g)z
Passes when the provided `exc` matches the structure of `template`.
Individual exceptions don't have to be the same objects or even pass
an equality test: they only need to be the same type and contain equal
`exc_obj.args`.
Nzunexpected exception: zexpected an exception like z
, got Noner   )r   r   ExceptionGroupassertEqual	__class__argsmessagelen
exceptionszipassertExceptionIsLike)r   exctemplateets        r   rP   *ExceptionIsLikeMixin.assertExceptionIsLike>   s     ;8+II.se45;II3H<zJK#~..S]]H,>,>?SXXa[(--*:;S[[(*:*:;S0#h6I6I2JKCNNH,?,?@**10 Ar   r?   N)r"   r@   rA   rB   rP   rC   r?   r   r   rE   rE   =   s    1r   rE   c                       \ rS rSrS rSrg)FloatsAreIdenticalMixinX   c                 $   Sn[        U5      (       d  [        U5      (       a"  [        U5      (       a  [        U5      (       a  gO,X:X  a'  US:w  a  g[        SU5      [        SU5      :X  a  gUS-  nU R                  UR                  X5      5        g)zFail unless floats x and y are identical, in the sense that:
(1) both x and y are nans, or
(2) both x and y are infinities, with the same sign, or
(3) both x and y are zeros, with the same sign, or
(4) x and y are both finite and nonzero, and x == y

z&floats {!r} and {!r} are not identicalNg        g      ?z: zeros have different signs)r   r   r   format)r   xyr   s       r   assertFloatsAreIdentical0FloatsAreIdenticalMixin.assertFloatsAreIdenticalY   sw     788uQxxQxxE!HHVCx#q!Xc1%5555		#**Q"#r   r?   N)r"   r@   rA   rB   r]   rC   r?   r   r   rW   rW   X   s    $r   rW   c                       \ rS rSrS rSrg)ComplexesAreIdenticalMixinq   c                     U R                  UR                  UR                  5        U R                  UR                  UR                  5        g)zFail unless complex numbers x and y have equal values and signs.

In particular, if x and y both have real (or imaginary) part
zero, but the zeros have different signs, this test will fail.

N)r]   realimag)r   r[   r\   s      r   assertComplexesAreIdentical6ComplexesAreIdenticalMixin.assertComplexesAreIdenticalr   s4     	%%affaff5%%affaff5r   r?   N)r"   r@   rA   rB   re   rC   r?   r   r   r`   r`   q   s    6r   r`   N)mathr   r   r   rE   rW   r`   r?   r   r   <module>rh      s6     6K 6Kr1 16$ $2	6!8 	6r   