o
    @»Bi„  ã                   @   sŠ   d dl mZ d dlZd dlZej dd¡re ¡  ne ¡  d dlm	Z	 d dl
mZ d dl
mZ d dl
mZ d dlZG d	d
„ d
ejƒZdS )é    )Úabsolute_importNÚUSE_TWISTEDF)Úwamp)Úmessage)Ú	exception)Úprotocolc                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚTestPeerExceptionsc                 C   sÚ  t  ¡ }t d¡G dd„ dtƒƒ}t d¡G dd„ dtƒƒ}| |¡ | |¡ t tjj	dd¡}| 
|¡}|  ||¡ |  |jd¡ t tjj	dd¡}| 
|¡}|  ||¡ |  |jd¡ t tjj	dd	¡}| 
|¡}|  |tj¡ |  |jd	¡ |  |jd¡ |  |ji ¡ tjtjj	dd	g d
¢d}| 
|¡}|  |tj¡ |  |jd	¡ |  |jd
¡ |  |ji ¡ tjtjj	dd	g d
¢dddœd}| 
|¡}|  |tj¡ |  |jd	¡ |  |jd
¡ |  |jdddœ¡ d S )Núcom.myapp.error1c                   @   ó   e Zd ZdS )zATestPeerExceptions.test_exception_from_message.<locals>.AppError1N©Ú__name__Ú
__module__Ú__qualname__© r   r   úe/var/www/html/Trade-python/venv/lib/python3.10/site-packages/autobahn/wamp/test/test_protocol_peer.pyÚ	AppError14   ó    r   úcom.myapp.error2c                   @   r
   )zATestPeerExceptions.test_exception_from_message.<locals>.AppError2Nr   r   r   r   r   Ú	AppError28   r   r   é@â r   zcom.myapp.error3)é   é   Úhello)Úargsé   Úbaz)ÚfooÚbar)r   Úkwargs)r   ÚBaseSessionr   ÚerrorÚ	ExceptionÚdefiner   ÚErrorÚCallÚMESSAGE_TYPEÚ_exception_from_messageÚassertIsInstanceÚassertEqualr   r   ÚApplicationErrorr   )ÚselfÚsessionr   r   ÚemsgÚexcr   r   r   Útest_exception_from_message1   sB   





"
z.TestPeerExceptions.test_exception_from_messagec                 C   sŽ   t  ¡ }t d¡G dd„ dtƒƒ}t d¡G dd„ dtƒƒ}| |¡ | |¡ |ƒ }| tjj	d|¡}|  
| ¡ tjj	tjj	di dg¡ d S )Nr	   c                   @   r
   )zATestPeerExceptions.test_message_from_exception.<locals>.AppError1Nr   r   r   r   r   r   c   r   r   r   c                   @   r
   )zATestPeerExceptions.test_message_from_exception.<locals>.AppError2Nr   r   r   r   r   r   g   r   r   r   )r   r   r   r    r!   r"   Ú_message_from_exceptionr   r$   r%   r(   Úmarshalr#   )r*   r+   r   r   r-   Úmsgr   r   r   Útest_message_from_exception`   s   

&z.TestPeerExceptions.test_message_from_exceptionN)r   r   r   r.   r2   r   r   r   r   r   /   s    /r   )Ú
__future__r   ÚosÚtxaioÚenvironÚgetÚuse_twistedÚuse_asyncioÚautobahnr   Úautobahn.wampr   r   r   ÚunittestÚTestCaser   r   r   r   r   Ú<module>   s   
