
    af                     d    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dS )    )wamp)message)	exception)protocolNc                       e Zd Zd Zd ZdS )TestPeerExceptionsc           	          t          j                    }t          j        d           G d dt                                }t          j        d           G d dt                                }|                    |           |                    |           t          j        t          j        j	        dd          }|
                    |          }|                     ||           |                     |j        d           t          j        t          j        j	        dd          }|
                    |          }|                     ||           |                     |j        d           t          j        t          j        j	        dd	          }|
                    |          }|                     |t          j                   |                     |j        d	           |                     |j        d           |                     |j        i            t          j        t          j        j	        dd	g d
          }|
                    |          }|                     |t          j                   |                     |j        d	           |                     |j        d
           |                     |j        i            t          j        t          j        j	        dd	g 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 )ATestPeerExceptions.test_exception_from_message.<locals>.AppError1N__name__
__module____qualname__     \/var/www/html/env/lib/python3.11/site-packages/autobahn/wamp/test/test_wamp_protocol_peer.py	AppError1r   +           Dr   r   com.myapp.error2c                       e Zd ZdS )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(   sa   &((	&	'	'	 	 	 	 		 	 	 
(	'	 
&	'	'	 	 	 	 		 	 	 
(	'	 	y!!!y!!! }W\6@RSS--d33c9---2&&&}W\6@RSS--d33c9---2&&& }W\6@RSS--d33c9#=>>>$67772&&&R(((}W\6@RYhYhYhiii--d33c9#=>>>$6777?333R(((}W\6@RYhYhYhy{  EJ  rK  rK  L  L  L--d33c9#=>>>$6777?333R%>%>?????r   c                 *   t          j                    }t          j        d           G d dt                                }t          j        d           G d dt                                }|                    |           |                    |            |            }|                    t          j        j	        d|          }| 
                    |                                t          j        j	        t          j        j	        di dg           d S )Nr
   c                       e Zd ZdS )ATestPeerExceptions.test_message_from_exception.<locals>.AppError1Nr   r   r   r   r   r6   Z   r   r   r   r   c                       e Zd ZdS )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!!!ikk--gl.GQTUU)CW\E^`fhjl~(  	A  	A  	A  	A  	Ar   N)r   r   r   r3   r<   r   r   r   r   r   &   s;        -@ -@ -@^A A A A Ar   r   )	autobahnr   autobahn.wampr   r   r   unittestTestCaser   r   r   r   <module>rA      s   <       ! ! ! ! ! ! # # # # # # " " " " " " BA BA BA BA BA* BA BA BA BA BAr   