
    IR-el"                     v    d dl Z d dlmZ d dlmZ d dlmZ d dlmZ ddl	m
Z
mZmZmZ d Z G d	 d
          ZdS )    N)conf)SAMPProxyError)SAMPHubServer)SAMPIntegratedClient   )
TEST_REPLYReceiverassert_outputrandom_paramsc                     dt           _        d S )NF)r   use_internet)modules    Hlib/python3.11/site-packages/astropy/samp/tests/test_standard_profile.pysetup_moduler      s    D    c                       e Zd Zed             Zed             Zed             Z ej        d          d             Z	d Z
d Zd	S )
TestStandardProfilec                     i S N selfs    r   hub_init_kwargsz#TestStandardProfile.hub_init_kwargs       	r   c                     i S r   r   r   s    r   client_init_kwargsz&TestStandardProfile.client_init_kwargs   r   r   c                     i S r   r   r   s    r   client_connect_kwargsz)TestStandardProfile.client_connect_kwargs   r   r   T)autousec                 h   t          |          | _        t          ddddd| j        | _        | j                                         t          di | j        | _         | j        j	        d| j        dd| j
         t          di | j        | _         | j        j	        d| j        dd| j
         d S )NFmultipler   )web_profilemode	pool_size)hubr$   r   )strtmpdirr   r   r%   startr   r   client1connectr   client2)r   tmp_paths     r   setup_methodz TestStandardProfile.setup_method   s    (mm  
J!
 
?C?S
 
 	+FFd.EFFUQUU$:TUUU+FFd.EFFUQUU$:TUUUUUr   c                     | j         j        r| j                                          | j        j        r| j                                         | j                                         d S r   )r)   is_connected
disconnectr+   r%   stopr   s    r   teardown_methodz#TestStandardProfile.teardown_method,   sW    <$ 	&L##%%%<$ 	&L##%%%r   c                 x   | j                                         | _        | j                                        | _        dddd| _        dddd| _        | j         j        sJ | j        j        sJ | j                                          | j                                         | j        | j         	                                vsJ | j        | j         	                                v sJ | j        | j        	                                v sJ | j        | j        	                                vsJ | j         
                    | j                  i k    sJ | j         
                    | j                  i k    sJ | j        
                    | j                  i k    sJ | j        
                    | j                  i k    sJ | j                             | j                   | j         
                    | j                  | j        k    sJ | j        
                    | j                  | j        k    sJ | j         
                    | j                  i k    sJ | j        
                    | j                  i k    sJ | j                            | j                   | j         
                    | j                  | j        k    sJ | j        
                    | j                  | j        k    sJ | j         
                    | j                  | j        k    sJ | j        
                    | j                  | j        k    sJ i }d|d	<   i |d
<   t          j        t                    5  | j                             | j        |           d d d            n# 1 swxY w Y   | j                             d          i k    sJ | j                            d          i k    sJ t#          | j                   }t#          | j                  }| j                            d|j                   | j                            d|j                   | j                             d|j                   | j                             d          | j        i ik    sJ | j                            d          i k    sJ d| j                             | j                  v sJ d| j                            | j                  v sJ t3          | j                  }| j                             | j                                        d|d           t7          d| j                                        | j        |d           t3          | j                  } | j         j        | j                                        dfi | t7          d| j                                        | j        |d           t3          | j                  }| j                             d|d           t7          d| j                                        | j        |d           t3          | j                  } | j         j        di | t7          d| j                                        | j        |d           t3          | j                  }| j                              | j                                        dd|d           t7          d| j                                        | j        |d           t3          | j                  } | j         j!        | j                                        ddfi | t7          d| j                                        | j        |d           t3          | j                  }| j         "                    dd|d           t7          d| j                                        | j        |d           t3          | j                  } | j         j#        di | t7          d| j                                        | j        |d           t3          | j                  }| j         $                    | j                                        d|dd          }|tJ          k    sJ t7          d| j                                        | j        |d           t3          | j                  } | j         j&        | j                                        dfddi|}|tJ          k    sJ t7          d| j                                        | j        |d           d S )NzClient 1zClient 1 Descriptionz1.1)z	samp.namezsamp.description.textzclient.versionzClient 2zClient 2 Descriptionz1.2table.load.votable
samp.mtypesamp.paramsztest-tag)r5   r6   <   )timeouttag1tag2   r8   )r4   )r:   r4   )'r)   get_public_id
client1_idr+   
client2_id	metadata1	metadata2r/   pingget_registered_clientsget_metadatadeclare_metadatapytestraisesr   notifyget_subscribed_clientsr	   bind_receive_notificationreceive_notificationbind_receive_callreceive_callbind_receive_responsereceive_responseget_subscriptionsr   r'   r
   get_private_keyenotify
notify_allenotify_allcallecallcall_all	ecall_allcall_and_waitr   ecall_and_wait)r   messagerec1rec2paramsresults         r   	test_mainzTestStandardProfile.test_main4   s	   ,4466,4466 $%;#
 
 $%;#
 
 |((((|(((( 	 dl&I&I&K&KKKKK$,"E"E"G"GGGGG$,"E"E"G"GGGGGdl&I&I&K&KKKKK |((99R????|((99R????|((99R????|((99R????%%dn555|((99T^KKKK|((99T^KKKK|((99R????|((99R????%%dn555|((99T^KKKK|((99T^KKKK|((99T^KKKK|((99T^KKKK
  4!#]>** 	: 	:L999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:
 |223GHHBNNNN|223GHHBNNNN %%%%.. $";	
 	
 	
 	&&';T=NOOO**:t7LMMM |223GHHORM
 
 
 
 
 |223GHHBNNNN#t|'E'Edo'V'VVVVV#t|'E'Edo'V'VVVVV t{++L&&((/GG	
 	
 	

 	 L((**O	
 	
 	
 	
 t{++L&&((*>	
 	
BH	
 	
 	
 	 L((**O	
 	
 	
 	
 t{++/GG	
 	
 	
 	 L((**O	
 	
 	
 	
 t{++  @@@@@ L((**O	
 	
 	
 	
 t{++L&&((/GG	
 	
 	
 	 L((**O	
 	
 	
 	
 t{++L&&((*6J	
 	
NT	
 	
 	
 	 L((**O	
 	
 	
 	
 t{++#7OO	
 	
 	
 	 L((**O	
 	
 	
 	
 t{++FFvFFF L((**O	
 	
 	
 	
 t{++++L&&((/GG , 
 
 #### L((**O	
 	
 	
 	
 t{++,,L&&((*>
 
HI
MS
 
 #### L((**O	
 	
 	
 	
 	
 	
s   &!NNNN)__name__
__module____qualname__propertyr   r   r   rE   fixturer-   r2   r_   r   r   r   r   r      s          X   X   X V^D!!!V V "!V  l
 l
 l
 l
 l
r   r   )rE   astropy.sampr   astropy.samp.errorsr   astropy.samp.hubr   astropy.samp.integrated_clientr   test_helpersr   r	   r
   r   r   r   r   r   r   <module>rj      s           . . . . . . * * * * * * ? ? ? ? ? ? L L L L L L L L L L L L  P
 P
 P
 P
 P
 P
 P
 P
 P
 P
r   