HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_serialport.cpython-38.pyc
U


W[��@s�dZddlmZddlmZddlmZddlmZzddl	m
Z
Wnek
r\dZ
YnXGdd	�d	e�Z
Gd
d�dej�ZdS)z+
Tests for L{twisted.internet.serialport}.
�)�unittest)�Failure)�Protocol)�ConnectionDone)�
serialportNc@s eZdZdZdd�Zdd�ZdS)�	DoNothingz.
    Object with methods that do nothing.
    cOsdS�N�)�self�args�kwargsr	r	�G/usr/lib/python3/dist-packages/twisted/internet/test/test_serialport.py�__init__szDoNothing.__init__cCsdd�S)Nc_sdSrr	)rrr	r	r
�<lambda>�z'DoNothing.__getattr__.<locals>.<lambda>r	)r
�attrr	r	r
�__getattr__szDoNothing.__getattr__N)�__name__�
__module__�__qualname__�__doc__rrr	r	r	r
rsrc@s$eZdZdZedkrdZdd�ZdS)�SerialPortTestszt
    Minimal testing for Twisted's serial port support.

    See ticket #2462 for the eventual full test suite.
    Nz%Serial port support is not available.csvGdd�dtj�}g�G�fdd�dt�}||�dt�d�}|��dg�tt��}|�|�|��dd|fg�d	S)
zr
        C{connectionMade} and C{connectionLost} are called on the protocol by
        the C{SerialPort}.
        c@seZdZeZdd�ZdS)z@SerialPortTests.test_connectionMadeLost.<locals>.DummySerialPortcSsdSrr	�r
r	r	r
�_finishPortSetup5szQSerialPortTests.test_connectionMadeLost.<locals>.DummySerialPort._finishPortSetupN)rrrrZ_serialFactoryrr	r	r	r
�DummySerialPort2srcs$eZdZ�fdd�Z�fdd�ZdS)z?SerialPortTests.test_connectionMadeLost.<locals>.SerialProtocolcs��d�dS)N�connectionMade��appendr�Zeventsr	r
r;szNSerialPortTests.test_connectionMadeLost.<locals>.SerialProtocol.connectionMadecs��d|f�dS)N�connectionLostr)r
�reasonrr	r
r>szNSerialPortTests.test_connectionMadeLost.<locals>.SerialProtocol.connectionLostN)rrrrrr	rr	r
�SerialProtocol:sr!�)ZreactorrrN)rZ
SerialPortrrZassertEqualrrr)r
rr!Zport�fr	rr
�test_connectionMadeLost,s

z'SerialPortTests.test_connectionMadeLost)rrrrr�skipr$r	r	r	r
r!sr)rZ
twisted.trialrZtwisted.python.failurerZtwisted.internet.protocolrZtwisted.internet.errorrZtwisted.internetr�ImportError�objectrZTestCaserr	r	r	r
�<module>s