
    h                     f    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ej                        Zy)    )wamp)message)	exception)protocolNc                       e Zd Zd Zd Zy)TestPeerExceptionsc           	         t        j                         }t        j                  d       G d dt                     }t        j                  d       G d dt                     }|j                  |       |j                  |       t        j                  t        j                  j                  dd      }|j                  |      }| j                  ||       | j                  |j                  d       t        j                  t        j                  j                  dd      }|j                  |      }| j                  ||       | j                  |j                  d       t        j                  t        j                  j                  dd	      }|j                  |      }| j                  |t        j                         | j                  |j                  d	       | j                  |j                  d       | j                  |j                   i        t        j                  t        j                  j                  dd	g d
      }|j                  |      }| j                  |t        j                         | j                  |j                  d	       | j                  |j                  d
       | j                  |j                   i        t        j                  t        j                  j                  dd	g d
ddd      }|j                  |      }| j                  |t        j                         | j                  |j                  d	       | j                  |j                  d
       | j                  |j                   ddd       y )Ncom.myapp.error1c                       e Zd Zy)ATestPeerExceptions.test_exception_from_message.<locals>.AppError1N__name__
__module____qualname__     f/var/www/Befach/backend/env/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_protocol_peer.py	AppError1r   +       r   r   com.myapp.error2c                       e Zd Zy)ATestPeerExceptions.test_exception_from_message.<locals>.AppError2Nr   r   r   r   	AppError2r   /   r   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excs         r   test_exception_from_messagez.TestPeerExceptions.test_exception_from_message(   s   &&(	&	'		 	 
(	 
&	'		 	 
(	 	y!y! }}W\\66@RS--d3c9-2&}}W\\66@RS--d3c9-2& }}W\\66@RS--d3c9#=#=>$672&R(}}W\\66@RYhi--d3c9#=#=>$67?3R(}}W\\66@RYhy{  EJ  rK  L--d3c9#=#=>$67?3R%>?r   c                    t        j                         }t        j                  d       G d dt                     }t        j                  d       G d dt                     }|j                  |       |j                  |        |       }|j                  t        j                  j                  d|      }| j                  |j                         t        j                  j                  t        j                  j                  di dg       y )Nr
   c                       e Zd Zy)ATestPeerExceptions.test_message_from_exception.<locals>.AppError1Nr   r   r   r   r   r6   Z   r   r   r   r   c                       e Zd Zy)ATestPeerExceptions.test_message_from_exception.<locals>.AppError2Nr   r   r   r   r   r8   ^   r   r   r   r   )r   r$   r   r%   r&   r'   _message_from_exceptionr   r)   r*   r-   marshalr(   )r/   r0   r   r   r2   msgs         r   test_message_from_exceptionz.TestPeerExceptions.test_message_from_exceptionW   s    &&(	&	'		 	 
(	 
&	'		 	 
(	 	y!y!k--gll.G.GQTU)C)CW\\E^E^`fhjl~(  	Ar   N)r   r   r   r3   r<   r   r   r   r   r   &   s    -@^Ar   r   )	autobahnr   autobahn.wampr   r   r   unittestTestCaser   r   r   r   <module>rA      s,   <  ! # " BA** BAr   