o
    ¼>hÁ  ã                   @   sN   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 )é    )Úwamp)Úmessage)Ú	exception)ÚprotocolNc                   @   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   úŠ/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/autobahn/wamp/test/test_wamp_protocol_peer.pyÚ	AppError1+   ó    r   úcom.myapp.error2c                   @   r   )zATestPeerExceptions.test_exception_from_message.<locals>.AppError2Nr	   r   r   r   r   Ú	AppError2/   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_message(   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   Z   r   r   r   c                   @   r   )zATestPeerExceptions.test_message_from_exception.<locals>.AppError2Nr	   r   r   r   r   r   ^   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_exceptionW   s   

&z.TestPeerExceptions.test_message_from_exceptionN)r
   r   r   r,   r0   r   r   r   r   r   &   s    /r   )	Úautobahnr   Úautobahn.wampr   r   r   ÚunittestÚTestCaser   r   r   r   r   Ú<module>   s   