o
    ¼>hÉ	  ã                   @   s6   d Z ddlmZ ddlmZmZ G dd„ dejƒZdS )z)
Tests for L{twisted.words.im.basechat}.
é    )Úunittest)ÚbasechatÚbasesupportc                   @   s8   e Zd ZdZddd„Zddd„Zddd	„Zdd
d„ZdS )ÚChatUITestsz7
    Tests for the L{basechat.ChatUI} chat client.
    ÚreturnNc                 C   s4   t  ¡ | _t dddddd¡| _t d| j¡| _d S )NÚ
fooAccountFÚfooÚpasswordÚhostÚport)r   ÚChatUIÚuir   ÚAbstractAccountÚaccountÚAbstractPersonÚperson©Úself© r   ú€/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/twisted/words/test/test_basechat.pyÚsetUp   s
   
ÿzChatUITests.setUpc                 C   sX   |   | jjd¡ |   | jj| j¡ | j | jd¡ |   | jjd¡ |   | jj| j¡ dS )zÏ
        L{basechat.ChatUI.contactChangedNick} on an
        L{twisted.words.im.interfaces.IPerson} who doesn't have an account
        associated with the L{basechat.ChatUI} instance has no effect.
        r   ÚbarN)ÚassertEqualr   Únamer   r   ÚcontactChangedNickr   r   r   r   Útest_contactChangedNickNoKey   s
   z(ChatUITests.test_contactChangedNickNoKeyc                 C   sr   | j | jj| j j| j jf< |  | j jd¡ |  | j j| j¡ | j | j d¡ |  | j jd¡ |  | j j| j¡ dS )z
        L{basechat.ChatUI.contactChangedNick} changes the name for an
        L{twisted.words.im.interfaces.IPerson}.
        r   r   N)r   r   Úpersonsr   r   r   r   r   r   r   r   Ú%test_contactChangedNickNoConversation%   s   z1ChatUITests.test_contactChangedNickNoConversationc                 C   s   | j | jj| j j| j jf< t | j | j¡}|| jj| j < |  | j jd¡ |  | j j| j¡ | j 	| j d¡ |  | j jd¡ |  | j j| j¡ dS )a  
        If an L{twisted.words.im.interfaces.IPerson} is in a
        L{basechat.Conversation}, L{basechat.ChatUI.contactChangedNick} causes a
        name change for that person in both the L{basechat.Conversation} and the
        L{basechat.ChatUI}.
        r   r   N)
r   r   r   r   r   r   ÚConversationÚconversationsr   r   )r   Úconversationr   r   r   Ú&test_contactChangedNickHasConversation3   s   z2ChatUITests.test_contactChangedNickHasConversation)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r!   r   r   r   r   r      s    


r   N)r%   Útwisted.trialr   Útwisted.words.imr   r   ÚTestCaser   r   r   r   r   Ú<module>   s   