
    9bh                     f    d dl mZmZ  G d d      Z G d d      Z G d d      Z G d d	e      Zy
)    )copysignisnanc                   L    e Zd Zd
dZd
dZd
dZd
dZd
dZd
dZd
dZ	d
d	Z
y)ExtraAssertionsNc                 n    t        ||      ry |d|}| j                  | j                  ||             y )Nz is not a subclass of 
issubclassfail_formatMessageselfcls
superclassmsgstandardMsgs        ?/opt/python-3.12.12/usr/lib/python3.12/test/support/testcase.pyassertIsSubclassz ExtraAssertions.assertIsSubclass   s9    c:&5j^D		$%%c;78    c                 n    t        ||      sy |d|}| j                  | j                  ||             y )Nz is a subclass of r   r   s        r   assertNotIsSubclassz#ExtraAssertions.assertNotIsSubclass   s9    #z*1*@		$%%c;78r   c                 4   t        ||      st        |t        j                        rd|j                  d|}n=t        |t
              rd|j                  d|}nt        |      j                  d|}| j                  | j                  ||             y y )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   assertHasAttrzExtraAssertions.assertHasAttr   s    sD!#u//0 ''77I$RC& ,S\\,<<NthW!%c!3!3 66OPTxXIId))#{;< "r   c                 4   t        ||      rt        |t        j                        rd|j                  d|}n=t        |t
              rd|j                  d|}nt        |      j                  d|}| j                  | j                  ||             y y )Nr   z has unexpected attribute r   z! object has unexpected attribute r   r!   s        r   assertNotHasAttrz ExtraAssertions.assertNotHasAttr   s    3#u//0 ''77QRVQYZC& ,S\\,<<VW[V^_!%c!3!3 66WX\W_`IId))#{;< r   c                 x    |j                  |      ry |d|}| j                  | j                  ||             y )Nz doesn't start with 
startswithr
   r   )r   sprefixr   r   s        r   assertStartsWithz ExtraAssertions.assertStartsWith&   s;    <<1&<		$%%c;78r   c                 t    |j                  |      sy | j                  | j                  ||d|             y )Nz starts with r(   )r   r*   r+   r   s       r   assertNotStartsWithz#ExtraAssertions.assertNotStartsWith,   s5    ||F#		$%%caU-z+JKLr   c                 x    |j                  |      ry |d|}| j                  | j                  ||             y )Nz doesn't end with endswithr
   r   )r   r*   suffixr   r   s        r   assertEndsWithzExtraAssertions.assertEndsWith1   s;    ::f/z:		$%%c;78r   c                 t    |j                  |      sy | j                  | j                  ||d|             y )Nz ends with r0   )r   r*   r2   r   s       r   assertNotEndsWithz!ExtraAssertions.assertNotEndsWith7   s5    zz&!		$%%caU+fZ+HIJr   N)r   
__module____qualname__r   r   r$   r&   r,   r.   r3   r5    r   r   r   r      s,    99==9M
9Kr   r   c                       e Zd Zd Zy)ExceptionIsLikeMixinc                 `   	 ||y || j                  d|        || j                  d|d       t        |t              sS| j                  |j                  |j                         | j                  |j
                  d   |j
                  d          y | j                  |j                  |j                         | j                  t        |j                        t        |j                               t        |j                  |j                        D ]  \  }}| j                  ||        y )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   rE   z*ExceptionIsLikeMixin.assertExceptionIsLike>   s    	 ;8+II.se45;II3H<zJK#~.S]]H,>,>?SXXa[(--*:;S[[(*:*:;S0#h6I6I2JKCNNH,?,?@1**1a0 Ar   N)r   r7   r8   rE   r9   r   r   r;   r;   =   s    1r   r;   c                       e Zd Zd Zy)FloatsAreIdenticalMixinc                     	 d}t        |      st        |      rt        |      r6t        |      r+y ||k(  r%|dk7  ry t        d|      t        d|      k(  ry |dz  }| j                  |j                  ||             y )Nz&floats {!r} and {!r} are not identicalg        g      ?z: zeros have different signs)r   r   r
   format)r   xyr   s       r   assertFloatsAreIdenticalz0FloatsAreIdenticalMixin.assertFloatsAreIdenticalY   sw    	 78uQxQxE!H!VCx#q!Xc1%5555		#**Q"#r   N)r   r7   r8   rP   r9   r   r   rK   rK   X   s    $r   rK   c                       e Zd Zd Zy)ComplexesAreIdenticalMixinc                     	 | j                  |j                  |j                         | j                  |j                  |j                         y r6   )rP   realimag)r   rN   rO   s      r   assertComplexesAreIdenticalz6ComplexesAreIdenticalMixin.assertComplexesAreIdenticalr   s9    	 	%%affaff5%%affaff5r   N)r   r7   r8   rV   r9   r   r   rR   rR   q   s    6r   rR   N)mathr   r   r   r;   rK   rR   r9   r   r   <module>rX      s6     6K 6Kr1 16$ $2	6!8 	6r   