
    e+                     Z    d dl mZmZ d dlmZ  G d de          Z G d de          ZdS )    )CommJupyterComm)ComparisonTestCasec                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestCommc                 "    t                       d S N)r   selfs    Clib/python3.11/site-packages/holoviews/tests/plotting/test_comms.pytest_init_commzTestComm.test_init_comm   s        c                 \    t          d          }|                     |j        d           d S NTestid)r   assertEqualr   r   comms     r   test_init_comm_idzTestComm.test_init_comm_id   s-    v&)))))r   c                 Z    d}|                      t          j        |          |           d S Nr   )r   r   decode)r   msgs     r   test_decodezTestComm.test_decode   s-    S))3/////r   c                 v     dd}d fd	}t          d|          }||_        |                    i            d S )Nc                      t          d          r   )	Exception)r   metadatas     r   raise_errorz=TestComm.test_handle_message_error_reply.<locals>.raise_error   s    F###r   c                                          |d         d                               |d                             d                     d S )Nmsg_typeError	tracebackzException: Test)r   
assertTrueendswithr   r    r   s     r   assert_errorz>TestComm.test_handle_message_error_reply.<locals>.assert_error   sJ    Xj17;;;OOH[1::;LMMNNNNNr   r   )r   on_msgNNr   send_handle_msg)r   r!   r)   r   s   `   r   test_handle_message_error_replyz(TestComm.test_handle_message_error_reply   sp    	$ 	$ 	$ 	$	O 	O 	O 	O 	O 	O vk222 	r   c                 l     d fd	}t          d          }||_        |                    i            d S )Nc                 :                         |ddd           d S )NReady )r#   contentr   r(   s     r   assert_readyz>TestComm.test_handle_message_ready_reply.<locals>.assert_ready   s'    XG'K'KLLLLLr   r   r   r+   r,   r   r6   r   s   `  r   test_handle_message_ready_replyz(TestComm.test_handle_message_ready_reply   sU    	M 	M 	M 	M 	M 	Mv 	r   c                 p     d fd	}t          d          }||_        |                    ddi           d S )Nc                 <                         |dddd           d S )Nr2   r3   
Testing id)r#   r4   comm_idr5   r(   s     r   r6   zKTestComm.test_handle_message_ready_reply_with_comm_id.<locals>.assert_ready%   s?    XG3?(A (A B B B B Br   r   r   r<   r;   r+   r,   r7   s   `  r   ,test_handle_message_ready_reply_with_comm_idz5TestComm.test_handle_message_ready_reply_with_comm_id$   s\    	B 	B 	B 	B 	B 	B v 	)\233333r   N)	__name__
__module____qualname__r   r   r   r/   r8   r=    r   r   r   r      sn          * * *0 0 0    4 4 4 4 4r   r   c                        e Zd Zd Zd Zd ZdS )TestJupyterCommc                 "    t                       d S r	   )r   r
   s    r   r   zTestJupyterComm.test_init_comm/   s    r   c                 \    t          d          }|                     |j        d           d S r   )r   r   r   r   s     r   r   z!TestJupyterComm.test_init_comm_id2   s0    f%%%&)))))r   c                 f    dddii}t          j        |          }|                     |d           d S )Nr4   datar   )r   r   r   )r   r   decodeds      r   r   zTestJupyterComm.test_decode6   s=    66*+$S))&)))))r   N)r>   r?   r@   r   r   r   rA   r   r   rC   rC   -   sA          * * ** * * * *r   rC   N)pyviz_commsr   r   holoviews.element.comparisonr   r   rC   rA   r   r   <module>rK      s    ) ) ) ) ) ) ) ) ; ; ; ; ; ;$4 $4 $4 $4 $4! $4 $4 $4N* * * * *( * * * * *r   