Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ 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 : |
o �bR6 � @ s d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z mZmZ ddl mZ ddlmZ dd lmZ G d d� d�ZG dd � d ej�ZG dd� dej�ZG dd� dej�ZG dd� de j�ZG dd� dej�ZG dd� dej�ZG dd� dej�ZG dd� dej�ZdS )z7 Tests for L{twisted.words.protocols.jabber.component} � )�sha1)�verifyObject)�failure)�unittest)� component�ijabber� xmlstream)�JID)�domish)�XmlPipec @ � e Zd Zdd� Zdd� ZdS )�DummyTransportc C s || _ d S �N)�list)�selfr � r �I/usr/lib/python3/dist-packages/twisted/words/test/test_jabbercomponent.py�__init__ � zDummyTransport.__init__c C s | j �|� d S r )r �append)r �bytesr r r �write s zDummyTransport.writeN)�__name__� __module__�__qualname__r r r r r r r � r c @ r )�#ComponentInitiatingInitializerTestsc C sj g | _ t�� | _d| j_t�| j�| _d| j_| j j| j_| j� � | j� d� d| j_t� | j�| _d S )N�secret�test:componentz�<stream:stream xmlns='test:component' xmlns:stream='http://etherx.jabber.org/streams' from='example.com' id='12345' version='1.0'>�12345)�outputr � Authenticator� authenticator�password� XmlStream� namespacer �send�connectionMade�dataReceived�sidr �ComponentInitiatingInitializer�init�r r r r �setUp s �z)ComponentInitiatingInitializerTests.setUpc C sb | j �� }| jd }| �d|j� | �d|j� | �td��� t|�� g |_ | j �|�� � |S )z? Test basic operations of component handshake. ���� handshaker � 12345secret) r+ � initializer �assertEqual�name�urir � hexdigest�str�childrenr r( �toXml)r �dr/ r r r � testHandshake- s z1ComponentInitiatingInitializerTests.testHandshakeN)r r r r- r: r r r r r s r c @ r )�ComponentAuthTestsc C � d| _ d S �NT)�authComplete)r �streamr r r � authPassedD r zComponentAuthTests.authPassedc C s� d| _ g }t�dd�}t�|�}t|�|_|�tj| j � |� � |�d� td�� � �d�}| �|d d| d � |�d � | �| j d� d S )NF�cjidr sv <stream:stream xmlns='jabber:component:accept' xmlns:stream='http://etherx.jabber.org/streams' from='cjid' id='12345'>r0 �ascii� s <handshake>s </handshake>�<handshake/>T)r>