Format: application/x-python-code
⬇ Download File (2.1 KB)
   1  o
   2  
   3  ��h	�@s`dZddlZddlmZddlmZGdd�de�ZGdd�de�Zd	d
   4  �Z	dd�Z
   5  d
   6  d�ZdS)z!Tests for CommandChainDispatcher.�N)�TryNext)�CommandChainDispatcherc@�eZdZdd�Zdd�ZdS)�OkaycC�||_d|_dS�NF��message�called��selfr	�r
   7  �Sc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/tests/test_hooks.py�__init__�
   8  z
   9  Okay.__init__cCsd|_|jS�NT)r
  10  r	�rr
  11  r
  12  r�__call__sz
  13  Okay.__call__N��__name__�
  14  __module__�__qualname__rrr
  15  r
  16  r
  17  rr�rc@r)�FailcCrrrrr
  18  r
  19  rrrz
  20  Fail.__init__cCsd|_t|j��r)r
  21  rr	rr
  22  r
  23  rrrz
  24  Fail.__call__Nrr
  25  r
  26  r
  27  rrrrcCs�td�}td�}td|fd|fg�}t�t��}|�Wd�n1s%wYt|j�dks3J�|jdus:J�|jdusAJ�dS)zTest two failing hooks�fail1�fail2r�
  28  NT)rr�pytestZraisesr�str�valuer
  29  )rr�dp�er
  30  r
  31  r� test_command_chain_dispatcher_ff's�r"cCs�td�}td�}td�}td�}td|fd|fd|fg�}|�|d�|�dks*J�|jd	us1J�|jd	us8J�|jd
  32  us?J�|jd
  33  usFJ�dS)z/Test a mixture of failing and succeeding hooks.rr�okay1�okay2rr��TFN)rrr�addr
  34  )rrr#r$r r
  35  r
  36  r�"test_command_chain_dispatcher_fofo4s�r(cCs.td�}td�}td|fg�}|�|d�dS)Nr#r$�)rrr')r#r$r r
  37  r
  38  r�)test_command_chain_dispatcher_eq_priorityHsr*)�__doc__rZIPython.core.errorrZIPython.core.hooksr�objectrrr"r(r*r
  39  r
  40  r
  41  r�<module>s
  42