HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_serialport.cpython-310.pyc
o

�b��@s�dZddlmZddlmZddlmZddlmZzddl	m
ZWney-dZ
YnweZ
Gdd	�d	�Z
Gd
d�dej�ZdS)z+
Tests for L{twisted.internet.serialport}.
�)�ConnectionDone)�Protocol)�Failure)�unittest)�
serialportNc@s eZdZdZdd�Zdd�ZdS)�	DoNothingz.
    Object with methods that do nothing.
    cO�dS�N�)�self�args�kwargsr
r
�G/usr/lib/python3/dist-packages/twisted/internet/test/test_serialport.py�__init__�zDoNothing.__init__cCsdd�S)Nc_rr	r
)rr
r
r
r�<lambda>sz'DoNothing.__getattr__.<locals>.<lambda>r
)r�attrr
r
r�__getattr__szDoNothing.__getattr__N)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rrsrc@s$eZdZdZedurdZdd�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>.DummySerialPortcSrr	r
�rr
r
r�_finishPortSetup4rzQSerialPortTests.test_connectionMadeLost.<locals>.DummySerialPort._finishPortSetupN)rrrr�_serialFactoryrr
r
r
r�DummySerialPort1srcs$eZdZ�fdd�Z�fdd�ZdS)z?SerialPortTests.test_connectionMadeLost.<locals>.SerialProtocolcs��d�dS)N�connectionMade��appendr��eventsr
rr:szNSerialPortTests.test_connectionMadeLost.<locals>.SerialProtocol.connectionMadecs��d|f�dS)N�connectionLostr)r�reasonr r
rr"=szNSerialPortTests.test_connectionMadeLost.<locals>.SerialProtocol.connectionLostN)rrrrr"r
r r
r�SerialProtocol9sr$�)�reactorrr"N)r�
SerialPortrr�assertEqualrrr")rrr$�port�fr
r r�test_connectionMadeLost+s

z'SerialPortTests.test_connectionMadeLost)rrrrr�skipr+r
r
r
rr!s
r)r�twisted.internet.errorr�twisted.internet.protocolr�twisted.python.failurer�
twisted.trialr�twisted.internetr�_serialport�ImportErrorr�TestCaserr
r
r
r�<module>s�