
    g                         d dl Z ddgZ G d de      Z e j                  de      Z G d de      Z G d d	e      Z G d
 de      Z	 G d de      Z
 G d de      Zd Zy)    NneverVerificationErrorc                       e Zd ZdZy)r   z}Indicates error during verification of invocations.

    Raised if verification fails. Error message contains the cause.
    N)__name__
__module____qualname____doc__     I/var/www/openai/venv/lib/python3.12/site-packages/mockito/verification.pyr   r      s     	r   errisinstancec                       e Zd Zd Zd Zd Zy)AtLeastc                     || _         y Nwanted_countselfr   s     r   __init__zAtLeast.__init__&   
    (r   c                 V    || j                   k  rt        d| j                   |fz        y )Nz&
Wanted at least: %i, actual times: %ir   r   r   
invocationactual_counts      r   verifyzAtLeast.verify)   s;    $+++#$M'+'8'8,&G%H I I ,r   c                 N    dt        |       j                  d| j                  dS N<z wanted=>typer   r   r   s    r   __repr__zAtLeast.__repr__.       #':#6#68I8IJJr   Nr   r   r   r   r   r%   r
   r   r   r   r   %       )I
Kr   r   c                       e Zd Zd Zd Zd Zy)AtMostc                     || _         y r   r   r   s     r   r   zAtMost.__init__2   r   r   c                 V    || j                   kD  rt        d| j                   |fz        y )Nz%
Wanted at most: %i, actual times: %ir   r   s      r   r   zAtMost.verify5   s;    $+++#$L'+'8'8,&G%H I I ,r   c                 N    dt        |       j                  d| j                  dS r   r"   r$   s    r   r%   zAtMost.__repr__:   r&   r   Nr'   r
   r   r   r*   r*   1   r(   r   r*   c                       e Zd Zd Zd Zd Zy)Betweenc                      || _         || _        y r   )wanted_from	wanted_to)r   r1   r2   s      r   r   zBetween.__init__>   s    &"r   c                     || j                   k  s|| j                  kD  r%t        d| j                   | j                  |fz        y )Nz+
Wanted between: [%i, %i], actual times: %i)r1   r2   r   r   s      r   r   zBetween.verifyB   sM    $***lT^^.K#>##T^^\BCD D /Lr   c                 h    dt        |       j                  d| j                  d| j                  dS )Nr    z [z, z]>)r#   r   r1   r2   r$   s    r   r%   zBetween.__repr__H   s)    J!1!14>>C 	Cr   Nr'   r
   r   r   r/   r/   =   s    #DCr   r/   c                       e Zd Zd Zd Zd Zy)Timesc                     || _         y r   r   r   s     r   r   zTimes.__init__M   r   r   c                    || j                   k(  ry |dk(  r|j                  j                  D cg c]  }|j                  |j                  k(  r| c}xs |j                  j                  }d|z  }|r"ddj	                  t        t        |            z  nd}t        ||d      | j                   dk(  rt        d||fz        t        d| j                   |fz        c c}w )	Nr   z!
Wanted but not invoked:

    %s
z
Instead got:

    %s
z
     
z%
Unwanted invocation of %s, times: %iz#
Wanted times: %i, actual times: %i)r   mockinvocationsmethod_namejoinmapstrr   )r   r   r   invocr<   wanted_sectioninstead_sections          r   r   zTimes.verifyP   s   4,,,1 ",!<!<!<((J,B,BB !< /
 ??..  8*D   ---C 567"$ 
 $*O<> >   A%'<!<012 2 ((N+/+<+<l*K)L M M1s   "Cc                 N    dt        |       j                  d| j                  dS r   r"   r$   s    r   r%   zTimes.__repr__q   r&   r   Nr'   r
   r   r   r6   r6   L   s    )MBKr   r6   c                       e Zd ZdZd Zd Zy)InOrderzVerifies invocations in order.

    Verifies if invocation was in expected order, and if yes -- degrades to
    original Verifier (AtLeast, Times, Between, ...).
    c                     || _         y)z

        @param original_verification: Original verification to degrade to if
                                      order of invocation was ok.
        N)original_verification)r   rH   s     r   r   zInOrder.__init__{   s     &;"r   c                     |j                   j                  D ]:  }|j                  r|j                  |      st	        d|d|d      d|_         n | j
                  j                  ||       y )Nz
Wanted z to be invoked,
got    z	 instead.T)r;   r<   verified_inordermatchesr   rH   r   )r   wanted_invocationcountr   s       r   r   zInOrder.verify   sn    +00<<J..(00<+ +J89 9 /3
+ = 	""))*;UCr   N)r   r   r   r	   r   r   r
   r   r   rF   rF   t   s    ;Dr   rF   )operator__all__AssertionErrorr   methodcaller__tracebackhide__objectr   r*   r/   r6   rF   r   r
   r   r   <module>rT      s   * '
(	 	 *H))/;LM 
Kf 
K
KV 
KCf C&KF &KPDf D: 	
r   