o
    9Bi	                     @   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/html/Trade-python/venv/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   