
    hKa                         d dl mZ d dlmZmZmZ d dlZ G d dej                        Z G d dej                        Z	 G d d	e
      Z G d
 de      Z G d dej                        Zy)    )wamp)PatternRegisterOptionsSubscribeOptionsNc                       e Zd Zd Zd Zd Zy)TestUrisc                 f    dD ],  }| j                  t        t        |t        j                         . y )N) zcom.myapp.<product:foo>.updatezcom.myapp.<123:int>.updatezcom.myapp.<:product>.updatezcom.myapp.<product:>.updatezcom.myapp.<int:>.update)assertRaises	Exceptionr   URI_TARGET_ENDPOINT)selfus     d/var/www/Befach/backend/env/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_uri_pattern.pytest_invalid_uriszTestUris.test_invalid_uris#   s*    A i!W5P5PQ    c                 r    dD ]2  }t        |t         j                        }| j                  |t                4 y )N)zcom.myapp.proc1123com.myapp.<product:int>.updatezIcom.myapp.<category:string>.<subcategory>.listcom.myapp.something..update)r   r   assertIsInstance)r   r   ps      r   test_valid_uriszTestUris.test_valid_uris-   s2    A 7667A!!!W-r   c           	         ddddifdddifddd	gfd
dddifdddifdgfddddifdddifdgfdddddfdddgfddddifgfddd d!ifgfg}|D ]}  }t        |d   t         j                        }|d"   D ]V  }|d   }|d"   }|'|j                  |      \  }}| j                  ||       6| j	                  t
        |j                  |       X  y )#Nr   zcom.myapp.0.updateproductr   zcom.myapp.123456.update@ )zcom.myapp.aaa.updateN)zcom.myapp..updateN)zcom.myapp.0.deleteNz!com.myapp.<product:string>.updatezcom.myapp.box.updatebox123456zcom.myapp.<product>.update0zcom.myapp.abc.updateabcz5com.myapp.<category:string>.<subcategory:string>.listzcom.myapp.cosmetic.shampoo.listcosmeticshampoo)categorysubcategory)zcom.myapp...listN)zcom.myapp.cosmetic..listN)zcom.myapp..shampoo.listNz4eth.pydefi.tradeclock.<clock_oid:str>.get_clock_infozIeth.pydefi.tradeclock.ba3b1e9f-3006-4eae-ae88-cf5896b36342.get_clock_info	clock_oidz$ba3b1e9f-3006-4eae-ae88-cf5896b36342z0eth.wamp.network.catalog.<catalog_adr:str>.ownerzIeth.wamp.network.catalog.0xAA8Cc377db31a354137d8Bb86D0E38495dbD5266.ownercatalog_adr*0xAA8Cc377db31a354137d8Bb86D0E38495dbD5266   )r   r   matchassertEqualr   r   )	r   teststestpatptesturikwargs_shouldargs_is	kwargs_iss	            r   test_parse_uriszTestUris.test_parse_uris7   s   -%	1~6*Y,?@.+,0  1')U);<*Y,AB+3 
 *%	3'78')U);<+, 
 E2\e4fg*21	G  D\EFHF  @\!MNPB 9 
B D$q'7#>#>?CaAh %a ,),3&GY$$Y>%%iC@ ! r   N)__name__
__module____qualname__r   r   r2    r   r   r   r   !   s    R.+Ar   r   c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)TestDecoratorsc                 2   t        j                  d      d        }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j"                         t        j                  d      dd       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j$                         t        j                  d      dd	       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j$                         t        j                  d
t'        dd            dd       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j(                  t&               | j                  |j
                  d   j(                  j*                  d       | j                  |j
                  d   j(                  j,                  d       | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d
       | j                  |j
                  d   j                   t        j$                         t        j                  dt'        dd            dd       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j(                  t&               | j                  |j
                  d   j(                  j*                  d       | j                  |j
                  d   j(                  j,                  d       | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j$                         y )Ncom.calculator.squarec                      yDo nothing.Nr6   )_s    r   squarez5TestDecorators.test_decorate_endpoint.<locals>.squareh       r   	_wampurisr'   r   &com.myapp.product.<product:int>.updatec                      yr<   r6   r   labels     r   update_productz=TestDecorators.test_decorate_endpoint.<locals>.update_productv   r@   r   ,com.myapp.<category:string>.<cid:int>.updatec                      yr<   r6   )r"   cids     r   updatez5TestDecorators.test_decorate_endpoint.<locals>.update   r@   r   zcom.myapp.circle.<name:string>wildcarddetailsr(   details_argc                      yz Do nothing. Nr6   )namerL   s     r   circlez5TestDecorators.test_decorate_endpoint.<locals>.circle   r@   r   zcom.myapp.something..updatec                      yrP   r6   )dynamicrL   s     r   	somethingz8TestDecorators.test_decorate_endpoint.<locals>.something   r@   r   NN)r   register
assertTruehasattrtyperA   listr)   lenr   r   is_endpointassertFalse
is_handleris_exceptionr.   _typeURI_TYPE_EXACTURI_TYPE_WILDCARDr   optionsr(   rN   )r   r?   rF   rJ   rR   rU   s         r   test_decorate_endpointz%TestDecorators.test_decorate_endpointg   s   	.	/	 
0	 	45V--.$67V--.2f..q17;((+779:))!,779:))!,99;<))!,0024KL))!,22G4J4JK	?	@	 
A	 	<=^556$>?^556:n66q97C003??AB11!4??AB11!4AACD11!488:<de11!4::G<U<UV	E	F	 
G	 	45V--.$67V--.2f..q17;((+779:))!,779:))!,99;<))!,0024bc))!,22G4M4MN	7&ZYO
Q	 
Q	  	45V--.$67V--.2f..q17;f..q199?K))!,44::JG))!,44@@)L((+779:))!,779:))!,99;<))!,0024TU))!,22G4M4MN	4&ZYO
Q	 
Q	  		;78Y001T9:Y00115i11!4g>i11!4<<oN,,Q/77==zJ,,Q/77CCYO	++A.::<=,,Q/::<=,,Q/<<>?,,Q/3357TU,,Q/55w7P7PQr   c                    t        j                  d      d        }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j"                         t        j                  d      dd       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j$                         t        j                  d      dd	       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d       | j                  |j
                  d   j                   t        j$                         t        j                  d
t'        dd            dd       }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       | j                  |j
                  d   t               | j                  |j
                  d   j(                  t&               | j                  |j
                  d   j(                  j*                  d       | j                  |j
                  d   j(                  j,                  d       | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                                | j                  |j
                  d   j                         d
       | j                  |j
                  d   j                   t        j$                         y )Ncom.myapp.on_shutdownc                       yr<   r6   r6   r   r   on_shutdownz9TestDecorators.test_decorate_handler.<locals>.on_shutdown   r@   r   rA   r'   r   )com.myapp.product.<product:int>.on_updatec                      yr<   r6   rD   s     r   on_product_updatez?TestDecorators.test_decorate_handler.<locals>.on_product_update   r@   r   /com.myapp.<category:string>.<cid:int>.on_updatec                      yr<   r6   r"   rI   rE   s      r   	on_updatez7TestDecorators.test_decorate_handler.<locals>.on_update   r@   r   zcom.myapp.on.<event:string>rK   rL   rM   c                      yrP   r6   )eventrL   s     r   on_eventz6TestDecorators.test_decorate_handler.<locals>.on_event   r@   r   rV   NNN)r   	subscriberX   rY   rZ   rA   r[   r)   r\   r   r   r^   r]   r_   r`   r.   ra   rb   rc   r   rd   r(   rN   )r   ri   rl   rp   rs   s        r   test_decorate_handlerz$TestDecorators.test_decorate_handler   sW   	/	0	 
1	 	[9:[223t;<[223Q7k33A6@..q1==?@--a0;;=>..q1>>@A..q15579PQ..q1779O9OP	C	D	 
E	 	 1;?@.889TAB.8891=/99!<gF*44Q7CCEF)33A6AACD*44Q7DDFG*44Q7;;=?jk*44Q7==w?X?XY	I	J	 
K	 		;78Y001T9:Y00115i11!4g>,,Q/;;=>	++A.99;<,,Q/<<>?,,Q/3357hi,,Q/55w7P7PQ	5(zyQ
S	 
S	  	+67X//0D89X//0!4h003W=h003;;=MN++A.66<<jI++A.66BBIN++A.::<=**1-88:;++A.;;=>++A.2246ST++A.44g6O6OPr   c                 	   t        j                  d       G d dt                     }| j                  t	        |d             | j                  t        |j                        t        k(         | j                  t        |j                        d       | j                  |j                  d   t               | j                  |j                  d   j                                | j                  |j                  d   j                                | j                  |j                  d   j                                | j                  |j                  d   j!                         d       | j                  |j                  d   j"                  t        j$                         t        j                  d       G d d	t                     }| j                  t	        |d             | j                  t        |j                        t        k(         | j                  t        |j                        d       | j                  |j                  d   t               | j                  |j                  d   j                                | j                  |j                  d   j                                | j                  |j                  d   j                                | j                  |j                  d   j!                         d       | j                  |j                  d   j"                  t        j&                         t        j                  d
       G d dt                     }| j                  t	        |d             | j                  t        |j                        t        k(         | j                  t        |j                        d       | j                  |j                  d   t               | j                  |j                  d   j                                | j                  |j                  d   j                                | j                  |j                  d   j                                | j                  |j                  d   j!                         d
       | j                  |j                  d   j"                  t        j&                         y )Ncom.myapp.errorc                       e Zd ZdZy)8TestDecorators.test_decorate_exception.<locals>.AppErrorr=   Nr3   r4   r5   __doc__r6   r   r   AppErrorrz          r   r}   rA   r'   r   0com.myapp.product.<product:int>.product_inactivec                       e Zd ZdZy)DTestDecorators.test_decorate_exception.<locals>.ProductInactiveErrorr=   Nr{   r6   r   r   ProductInactiveErrorr     r~   r   r   2com.myapp.<category:string>.<product:int>.inactivec                       e Zd ZdZy)CTestDecorators.test_decorate_exception.<locals>.ObjectInactiveErrorr=   Nr{   r6   r   r   ObjectInactiveErrorr     r~   r   r   )r   errorr   rX   rY   rZ   rA   r[   r)   r\   r   r   r^   r]   r_   r`   r.   ra   rb   rc   )r   r}   r   r   s       r   test_decorate_exceptionz&TestDecorators.test_decorate_exception   s   	%	&	y 	 
'	 	+67X//0D89X//0!4h003W=++A.::<=++A.99;<**1-::<=++A.2246GH++A.44g6L6LM	F	G	9 	 
H	 	 4kBC1;;<DE1;;<a@2<<Q?I-77:FFHI-77:EEGH,66q9FFHI-77:>>@Btu-77:@@'B[B[\	H	I	) 	 
J	 	 3[AB0::;tCD0::;Q?1;;A>H,66q9EEGH,66q9DDFG+55a8EEGH,66q9==?Auv,66q9??AZAZ[r   c                    t        j                  d      d        }|j                  d   j                  d      \  }}| j	                   |di |d       t        j                  d      dd       }|j                  d   j                  d      \  }}d|d	<   | j	                   |di |d
       t        j                  d      dd       }|j                  d   j                  d      \  }}d|d	<   | j	                   |di |d       y )Nr:   c                     | S Nr6   xs    r   r?   z<TestDecorators.test_match_decorated_endpoint.<locals>.square  s    Hr   r     rB   c                 
    | |fS r   r6   rD   s     r   rF   zDTestDecorators.test_match_decorated_endpoint.<locals>.update_product&      E>!r   zcom.myapp.product.123456.updatefoobarrE   r   r   rG   c                     | ||fS r   r6   ro   s      r   rJ   z<TestDecorators.test_match_decorated_endpoint.<locals>.update.      S%''r   r   r   r   )r   rV   r6   rt   )r   rW   rA   r(   r)   )r   r?   argskwargsrF   rJ   s         r   test_match_decorated_endpointz,TestDecorators.test_match_decorated_endpoint  s   	.	/	 
0	 ''*001HIf.v.4	?	@	" 
A	" &//2889Z[f"w1&13EF	E	F	( 
G	( ''*001RSf"w)&)+HIr   c                    t        j                  d      d        }|j                  d   j                  d      \  }}| j	                   |di |d        t        j                  d      dd       }|j                  d   j                  d      \  }}d|d<   | j	                   |di |d	       t        j                  d
      dd       }|j                  d   j                  d      \  }}d|d<   | j	                   |di |d       y )Nrg   c                       y r   r6   r6   r   r   ri   z@TestDecorators.test_match_decorated_handler.<locals>.on_shutdown7  s    r   r   rj   c                 
    | |fS r   r6   rD   s     r   rl   zFTestDecorators.test_match_decorated_handler.<locals>.on_product_update>  r   r   z"com.myapp.product.123456.on_updater   rE   r   rm   c                     | ||fS r   r6   ro   s      r   rp   z>TestDecorators.test_match_decorated_handler.<locals>.on_updateF  r   r   r   r6   rV   rt   )r   ru   rA   r(   r)   )r   ri   r   r   rl   rp   s         r   test_match_decorated_handlerz+TestDecorators.test_match_decorated_handler6  s   	/	0	 
1	 #,,Q/556MNf.v.5	C	D	" 
E	" )2215;;<`af"w*4V46HI	I	J	( 
K	( !**1-334XYf"w,V,.KLr   c                 n   t        j                  d       G d dt                     }|j                  d   j	                  d      \  }}| j                   |di | |d             t        j                  d       G d dt                     }|j                  d   j	                  d	      \  }}| j                   |di | |dd
             t        j                  d       G d dt                     }|j                  d   j	                  d      \  }}| j                   |di | |ddd
             y )Nrx   c                       e Zd Zd Zd Zy)?TestDecorators.test_match_decorated_exception.<locals>.AppErrorc                 0    t         j                  | |       y r   )r   __init__)r   msgs     r   r   zHTestDecorators.test_match_decorated_exception.<locals>.AppError.__init__R  s    ""4-r   c                 j    | j                   |j                   k(  xr | j                  |j                  k(  S r   )	__class__r   r   others     r   __eq__zFTestDecorators.test_match_decorated_exception.<locals>.AppError.__eq__U  s'    ~~8TTYY%**=TTr   Nr3   r4   r5   r   r   r6   r   r   r}   r   O  s    .Ur   r}   r   fuckr   c                       e Zd ZddZd Zy)KTestDecorators.test_match_decorated_exception.<locals>.ProductInactiveErrorNc                 >    t         j                  | |       || _        y r   r   r   r   r   r   r   s      r   r   zTTestDecorators.test_match_decorated_exception.<locals>.ProductInactiveError.__init___      ""4-&r   c                     | j                   |j                   k(  xr4 | j                  |j                  k(  xr | j                  |j                  k(  S r   )r   r   r   r   s     r   r   zRTestDecorators.test_match_decorated_exception.<locals>.ProductInactiveError.__eq__c  s?    ~~8vTYY%**=TvY]YeYeinivivYvvr   r   r   r6   r   r   r   r   \  s    'wr   r   z)com.myapp.product.123456.product_inactiver   r   c                       e Zd ZddZd Zy)JTestDecorators.test_match_decorated_exception.<locals>.ObjectInactiveErrorNc                 L    t         j                  | |       || _        || _        y r   )r   r   r"   r   )r   r   r"   r   s       r   r   zSTestDecorators.test_match_decorated_exception.<locals>.ObjectInactiveError.__init__l  s     ""4- (&r   c                     | j                   |j                   k(  xrO | j                  |j                  k(  xr4 | j                  |j                  k(  xr | j                  |j                  k(  S r   )r   r   r"   r   r   s     r   r   zQTestDecorators.test_match_decorated_exception.<locals>.ObjectInactiveError.__eq__q  sY    ~~8 VTYY%**=T VMMU^^3V8<8UVr   rV   r   r6   r   r   r   r   i  s    '
Vr   r   z!com.myapp.product.123456.inactiver   )r   )r   r   r   rA   r(   r)   )r   r}   r   r   r   r   s         r   test_match_decorated_exceptionz-TestDecorators.test_match_decorated_exceptionN  sB   	%	&	Uy 	U 
'	U  ))!,223DEf3F3Xf5EF	F	G	w9 	w 
H	w ,55a8>>?jkf-??AUV\^dAef	H	I		V) 		V 
J		V +44Q7==>abf,>v>@STZ\egm@nor   N)	r3   r4   r5   re   rv   r   r   r   r   r6   r   r   r8   r8   e   s*    MR^;Qz)\VJ0M0(pr   r8   c                       e Zd Zd Zy)KwExceptionc                 >    t        j                  | g|  || _        y r   )r   r   r   )r   r   r   s      r   r   zKwException.__init__z  s    4'$'r   Nr3   r4   r5   r   r6   r   r   r   r   y  s    r   r   c                   "    e Zd Zd ZddZddZy)MockSessionc                      i | _         i | _        y r   )_ecls_to_uri_pat_uri_to_ecls)r   s    r   r   zMockSession.__init__  s     "r   Nc                 6   |Rt        |d      sJ |j                  | j                  |<   || j                  |j                  d   j	                         <   y t        |d      rJ t        |t
        j                        g| j                  |<   || j                  |<   y )NrA   r   )rY   rA   r   r   r.   r   URI_TARGET_HANDLER)r   	exceptionr   s      r   definezMockSession.define  s    =I{343/8/B/BD!!),>GDi11!488:;	;78707w?Y?Y0Z/[D!!),'0De$r   c                    || j                   v r7| j                   |   }	 |r|r	 ||i |}n |di |}n|r || }n |       }|S |xs g }|xs i }t        |g|i |}|S # t        $ r t        |g|i |}Y |S w xY w)Nr6   )r   r   r   )r   r   r   r   eclsexcs         r   	map_errorzMockSession.map_error  s     D%%%$$U+D: "D3F3"nVn"Dk"f 
 :2D\rFe5d5f5C
  :!%9$9&9 
:s   %A# #A?>A?r   rV   )r3   r4   r5   r   r   r   r6   r   r   r   r     s    1r   r   c                   6    e Zd Zd Zd Zd Zd Zd Zd Zd Z	y)	TestDecoratorsAdvancedc                 6    d }| j                  t        |       y )Nc                  R    t        j                  d       G d dt                     } y )Nzcom.test.errorc                       e Zd Zy)WTestDecoratorsAdvanced.test_decorate_exception_non_exception.<locals>.test.<locals>.FooNr3   r4   r5   r6   r   r   Foor     s    r   r   )r   r   object)r   s    r   r+   zJTestDecoratorsAdvanced.test_decorate_exception_non_exception.<locals>.test  s%    ZZ()f  *r   )r   r   )r   r+   s     r   %test_decorate_exception_non_exceptionz<TestDecoratorsAdvanced.test_decorate_exception_non_exception  s    	 	)T*r   c                    t        j                  d      t        j                  d      d               }| j                  t        |d             | j                  t	        |j
                        t        k(         | j                  t        |j
                        d       t        d      D ]  }| j                  |j
                  |   t               | j                  |j
                  |   j                                | j                  |j
                  |   j                                | j                  |j
                  |   j                                | j                  |j
                  |   j                   t        j"                          | j                  |j
                  d   j%                         d       | j                  |j
                  d   j%                         d       y )Nzcom.oldapp.oldprocr:   c                      yr<   r6   r   s    r   r?   zFTestDecoratorsAdvanced.test_decorate_endpoint_multiple.<locals>.square  r@   r   rA      r   r'   )r   rW   rX   rY   rZ   rA   r[   r)   r\   ranger   r   r]   r^   r_   r`   ra   rb   r.   )r   r?   is      r   test_decorate_endpoint_multiplez6TestDecoratorsAdvanced.test_decorate_endpoint_multiple  s~    
+	,	.	/	 
0 
-	 	45V--.$67V--.2qA!!&"2"21"5w?OOF,,Q/;;=>V--a0;;=>V--a0==?@V--a0668N8NO  	))!,0024KL))!,0024HIr   c                    t        j                  d       G d dt                     }	  |d      # t        $ r7}| j                  |j                  d   j                         d       Y d }~nd }~ww xY wt        j                  d       G d dt                     }	  |dd	      # t        $ r7}| j                  |j                  d   j                         d       Y d }~nd }~ww xY wt               }|j                  |       y )
Nrx   c                       e Zd Zy)ITestDecoratorsAdvanced.test_marshal_decorated_exception.<locals>.AppErrorNr   r6   r   r   r}   r         r   r}   r   r   r   c                       e Zd ZddZy)UTestDecoratorsAdvanced.test_marshal_decorated_exception.<locals>.ProductInactiveErrorNc                 >    t         j                  | |       || _        y r   r   r   s      r   r   z^TestDecoratorsAdvanced.test_marshal_decorated_exception.<locals>.ProductInactiveError.__init__  r   r   r   r   r6   r   r   r   r     s    'r   r   r   )r   r   r   r)   rA   r.   r   r   )r   r}   er   sessions        r    test_marshal_decorated_exceptionz7TestDecoratorsAdvanced.test_marshal_decorated_exception  s    	%	&	y 	 
'		F6"" 	FQ[[^//13DEE	F 
F	G	'9 	' 
H	'	g&vv66 	gQ[[^//13eff	g -x s,   1 	A1-A,,A1	B% %	C%.-C  C%c                     t               } G d dt              }| j                  t        |j                  |       |j                  |d       |j	                  d      }| j                  ||       y )Nc                       e Zd Zy)JTestDecoratorsAdvanced.test_define_exception_undecorated.<locals>.AppErrorNr   r6   r   r   r}   r     s    r   r}   rx   )r   r   r   r   r   r   r   r   r}   r   s       r   !test_define_exception_undecoratedz8TestDecoratorsAdvanced.test_define_exception_undecorated  s]    -	y 	
 	)W^^X>x!23 12c8,r   c                    t               }t        j                  d       G d dt                     }| j	                  t        |j
                  |d       |j                  |       |j                  d      }| j                  ||       y )Nrx   c                       e Zd Zy)HTestDecoratorsAdvanced.test_define_exception_decorated.<locals>.AppErrorNr   r6   r   r   r}   r     r   r   r}   )r   r   r   r   r   r   r   r   r   s       r   test_define_exception_decoratedz6TestDecoratorsAdvanced.test_define_exception_decorated  st    -	%	&	y 	 
'	
 	)W^^X?PQx  12c8,r   c                 f    t               }|j                  d      }| j                  |t               y )Nrx   )r   r   r   r   )r   r   r   s      r   test_map_exception_undefinedz3TestDecoratorsAdvanced.test_map_exception_undefined  s*    - 12c9-r   c                    t               }t        j                  d       G d dt                     }t        j                  d       G d dt                     }|j	                  |       |j	                  |       dg i |fddgi |fdg di |fdg i |fdg d	d
i|ffD ]S  }|\  }}}}|j                  |||      }	| j                  |	|       | j                  t        |	j                        |       U y )Nrx   c                       e Zd Zy)@TestDecoratorsAdvanced.test_map_exception_args.<locals>.AppErrorNr   r6   r   r   r}   r   #  r   r   r}   z com.myapp.error.product_inactivec                       e Zd ZddZy)LTestDecoratorsAdvanced.test_map_exception_args.<locals>.ProductInactiveErrorNc                     || _         y r   )r   )r   r   s     r   r   zUTestDecoratorsAdvanced.test_map_exception_args.<locals>.ProductInactiveError.__init__)  s	    &r   r   r   r6   r   r   r   r   '  s    'r   r   you are doing it wrong)r   r'   r      r   r   )
r   r   r   r   r   r   r   r)   r[   r   )
r   r   r}   r   r+   r   r   r   r   r   s
             r   test_map_exception_argsz.TestDecoratorsAdvanced.test_map_exception_args  s   -	%	&	y 	 
'	 
6	7	'9 	' 
8	'
 	x +, B1!9 :BI CRR/R9MN/i5HJ^_
D )-%E4##E48C!!#t,T#((^T2
r   N)
r3   r4   r5   r   r   r   r   r   r   r   r6   r   r   r   r     s&    +J,!4- -".3r   r   )autobahnr   autobahn.wamp.urir   r   r   unittestTestCaser   r8   r   r   r   r   r   r6   r   r   <module>r      sn   6  H H AAx   AAHQpX&& Qph) ".& .bB3X.. B3r   