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 :  /lib/python3/dist-packages/twisted/internet/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/twisted/internet/test/__pycache__/test_stdio.cpython-310.pyc
o

�b��@s`dZddlmZddlmZddlmZe��sddlm	Z	Gdd�de�Z
e��e
�
��dS)	z&
Tests for L{twisted.internet.stdio}.
�)�Protocol)�ReactorBuilder)�platform)�
StandardIOc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Ze�
�r.dZdSdS)�StdioFilesTestszI
    L{StandardIO} supports reading and writing to filesystem files.
    cCs4|��}t|d���t|d�|_|�|jj�dS)N�wbzrb+)�mktemp�open�close�	extraFile�
addCleanup)�self�path�r�B/usr/lib/python3/dist-packages/twisted/internet/test/test_stdio.py�setUpszStdioFilesTests.setUpcs�|���G�fdd�dt�}|��}t|d��
}|�d�Wd�n1s'wYt|d��}|�}t||��|j���d�|���Wd�n1sQwY|�	|j
d�dS)zc
        Adding a filesystem file reader to a reactor will make sure it is
        polled.
        cseZdZdZ�fdd�ZdS)z4StdioFilesTests.test_addReader.<locals>.DataProtocol�cs(|j|7_|jdkr���dSdS)N�hello!)�data�stop)r
r��reactorrr�dataReceived&s
�zAStdioFilesTests.test_addReader.<locals>.DataProtocol.dataReceivedN)�__name__�
__module__�__qualname__rrrrrr�DataProtocol#srrrN�rb��stdin�stdoutr)�buildReactorrrr	�writer�filenor�
runReactor�assertEqualr)r
rr�f�protocolrrr�test_addReaders"���zStdioFilesTests.test_addReadercs�|���G�fdd�dt�}|��}t|d��.}|�}t||��|j���d�|j�d�|j�d�|j�	�|�
��Wd�n1sHwYt|d��}|�|��d	�Wd�dS1sfwYdS)
zc
        Adding a filesystem file writer to a reactor will make sure it is
        polled.
        cseZdZ�fdd�ZdS)z:StdioFilesTests.test_addWriter.<locals>.DisconnectProtocolcs���dS)N)r)r
�reasonrrr�connectionLostHszIStdioFilesTests.test_addWriter.<locals>.DisconnectProtocol.connectionLostN)rrrr*rrrr�DisconnectProtocolGsr+r�r rr�hellos, worldNrshello, world)
r!rrr	rr#r�	transportr"�loseConnectionr$r%�read)r
r+rr&r'rrr�test_addWriter@s&�
�"�zStdioFilesTests.test_addWritercCs�|��}|�|j|�|��}t|d���t|d��.}tt�|��|j	��|d�}|�
|j|���|j�
�|�|j|���Wd�dS1sLwYdS)zq
        Removing a filesystem file reader from a reactor will make sure it is
        no longer polled.
        rrrN)r!r�unbuildReactorrr	r
rrr#r�assertIn�_reader�
getReaders�stopReading�assertNotIn�r
rrr&�stdiorrr�test_removeReader`s�
"�z!StdioFilesTests.test_removeReadercCs�|��}|�|j|�t|��d�|_}t�}t||��|j	��|d�}|j
�d�|�|j
|���|j
��|�|j
|���dS)zq
        Removing a filesystem file writer from a reactor will make sure it is
        no longer polled.
        rr,r-N)r!rr2r	rr&rrr#rr.r"r3�_writer�
getWriters�stopWritingr7)r
rr&r'r9rrr�test_removeWriterws�
z!StdioFilesTests.test_removeWritercCs�|��}|�|j|�|��}t|d���t|d�|_}tt�|�	�|j
�	�|d�}|��}|�|j
|�|�|j
|���dS)zk
        Calling C{removeAll} on a reactor includes descriptors that are
        filesystem files.
        rrrN)r!rr2rr	r
r&rrr#r�	removeAllr3r4r7r5)r
rrr&r9�removedrrr�test_removeAll�s�zStdioFilesTests.test_removeAllcCs�|��}|�|j|�|��}t|d���t|d�� }tt�|��|j	��|d�}|�
|j|���Wd�dS1s>wYdS)zW
        C{reactor.getReaders} includes descriptors that are filesystem files.
        rrrN)
r!rr2rr	r
rrr#rr3r4r5r8rrr�test_getReaders�s�"�zStdioFilesTests.test_getReaderscCsx|��}|�|j|�t|��d�|_}tt�|��|j	��|d�}|�
|j|���|j�
�|�|j|���dS)zW
        C{reactor.getWriters} includes descriptors that are filesystem files.
        rr,N)r!rr2r	rr&rrr#rr7r;r<�startWritingr3)r
rr&r9rrr�test_getWriters�s�
zStdioFilesTests.test_getWriterszoStandardIO does not accept stdout as an argument to Windows. Testing redirection to a file is therefore harder.N)rrr�__doc__rr(r1r:r>rArBrDr�	isWindows�skiprrrrrs$ ��rN)rE�twisted.internet.protocolr�#twisted.internet.test.reactormixinsr�twisted.python.runtimerrF�twisted.internet.stdiorr�globals�update�makeTestCaseClassesrrrr�<module>sG

Anon7 - 2022
AnonSec Team