a
    õ£Bee  ã                   @   sL   d dl mZ d dlZd dlmZmZmZmZ d dlmZ G dd„ deƒZ	dS )é    )ÚThreadN)ÚAgainÚContextTerminatedÚZMQErrorÚstrerror)ÚBaseZMQTestCasec                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚTestZMQErrorc                 C   s(   t dƒD ]}t|ƒ}t|tƒsJ ‚qdS )z'test that strerror gets the right type.é
   N)Úranger   Ú
isinstanceÚstr)ÚselfÚiÚe© r   úW/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/zmq/tests/test_error.pyÚtest_strerror   s    zTestZMQError.test_strerrorc                 C   s<   t dƒD ].}t|ƒ}|j|ks"J ‚t|ƒt|ƒksJ ‚qd S )Nr	   )r
   r   Úerrnor   r   )r   r   r   r   r   r   Útest_zmqerror   s    zTestZMQError.test_zmqerrorc                 C   s@   | j  tj¡}|  t|jtj¡ |  tj	|jtj¡ | 
¡  d S )N)ÚcontextÚsocketÚzmqÚREPÚassertRaisesr   ÚrecvÚNOBLOCKÚassertRaisesErrnoÚEAGAINÚclose)r   Úsr   r   r   Ú
test_again   s    zTestZMQError.test_againc                 C   s^   | j  tj¡}t| j jd�}| ¡  |  t|j	tj
¡ |  tj|j	tj
¡ | ¡  | ¡  d S )N)Útarget)r   r   r   r   r   ÚtermÚstartr   r   r   r   r   ÚTERMr   Újoin)r   r   Útr   r   r   Úatest_ctxterm   s    zTestZMQError.atest_ctxtermN)Ú__name__Ú
__module__Ú__qualname__r   r   r    r'   r   r   r   r   r      s   r   )
Ú	threadingr   r   r   r   r   r   Z	zmq.testsr   r   r   r   r   r   Ú<module>   s   