
    af                     P   d dl Z d dlZd dlZd dlmZmZ d dlZd dlmZ de j        v r#e j        d         rd dl	mZ  ej
                     nd dlZ ej                     d dlmZ d dlmZ erd dlmZ  ee d	           G d
 dej                              Z G d de          ZdS )    N)randintrandom)skipIfUSE_TWISTED)unittest)HAS_XBR)InvalidPayload)FbsRepositoryz#package autobahn[xbr] not installedc                       e Zd ZdZd ZdS )TestFbsBasez;
    FlatBuffers tests base class, loads test schemas.
    c                     t          d          | _        g | _        dD ]^}t          j        dd                    |                    }| j                            |           | j                            |           _d S )Nautobahn)z	demo.bfbszwamp-control.bfbszxbr/test/catalog/schema/{})r
   repoarchivespkg_resourcesresource_filenameformatloadappend)selffbs_filearchives      X/var/www/html/env/lib/python3.11/site-packages/autobahn/xbr/test/test_xbr_schema_demo.pysetUpzTestFbsBase.setUp   s    !*--	: 	* 	*H#5jB^BeBefnBoBoppGINN7###M  ))))	* 	*    N)__name__
__module____qualname____doc__r    r   r   r   r      s-         * * * * *r   r   c                       e Zd Zd Zd ZdS )TestFbsValidateTestTableAc                    dt          dd          t          dd          t          dd          t          dd          t          dd          t          dd	          t          d
d          t          dd          dt                      z   dt                      z   g}	 | j                            d|i            d S # t          $ r$}|                     dd|            Y d }~d S d }~ww xY w)NT                                    @demo.TestTableA)argskwargsFz*Inventory.validate() raised an exception: )r   r   r   validate	Exception
assertTrue)r   
valid_argsexcs      r   test_validate_TestTableA_validz8TestFbsValidateTestTableA.test_validate_TestTableA_valid)   s   D"AsOOHb!!A{##Hb!!A{##Hb!!A{##&((N&((N

	WI0z"MMMMM 	W 	W 	WOOE#UPS#U#UVVVVVVVVV	Ws   B< <
C*C%%C*c                    dt          dd          t          dd          t          dd          t          dd          t          dd          t          dd	          t          d
d          t          dd          dt                      z   dt                      z   g}t          t          |                    D ]P}t	          j        |          }|dk    rd|d<   nd||<   |                     t          d| j        j        d|i            Q	 t          t          |                    D ]D}t	          j        |          }d ||<   |                     t          d| j        j        d|i            E	 t          t          |                    D ]5}|d |         }|                     t          d| j        j        d|i            6d S )NTr$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r   i  zinvalid typer/   zmissing positional argument)	r   r   rangelencopyassertRaisesRegexr	   r   r2   )r   r5   iinvalid_argss       r    test_validate_TestTableA_invalidz:TestFbsValidateTestTableA.test_validate_TestTableA_invalid=   s   D"AsOOHb!!A{##Hb!!A{##Hb!!A{##&((N&((N

 s:'' 
	H 
	HA9Z00LAvv"%Q #'Q"">>49CU#4lBH H H H	L3z??++ L L#y44"&Q&&~~tyGY'8,L L L L	L3z??++ L L)"1"~&&~7TVZV_Vh'8,L L L LL Lr   N)r   r   r   r7   r?   r    r   r   r"   r"   '   s:        W W W(*L *L *L *L *Lr   r"   )osr;   r   r   r   txaior   r   environtwisted.trialuse_twisteduse_asyncioautobahn.xbrr   autobahn.wamp.exceptionr	   r
   TestCaser   r"   r    r   r   <module>rI      s~   				      " " " " " " " "       BJ2:m#<&&&&&&EOOOE             2 2 2 2 2 2
 +****** G:;;* * * * *(# * * <;*@L @L @L @L @L @L @L @L @L @Lr   