§
    ÈtºfÅ  ã                   ó¨   — d Z ddlmZ ddlmZ ddlmZ ddlmZ 	 ddl	m
Z eZ
n# e$ r dZ
Y nw xY w G d„ d	¦  «        Z G d
„ dej        ¦  «        ZdS )z+
Tests for L{twisted.internet.serialport}.
é    )ÚConnectionDone)ÚProtocol)ÚFailure)Úunittest)Ú
serialportNc                   ó   — e Zd ZdZd„ Zd„ ZdS )Ú	DoNothingz.
    Object with methods that do nothing.
    c                 ó   — d S ©N© )ÚselfÚargsÚkwargss      úd/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/internet/test/test_serialport.pyÚ__init__zDoNothing.__init__   s   € Øˆó    c                 ó   — d„ S )Nc                  ó   — d S r   r   )r   r   s     r   ú<lambda>z'DoNothing.__getattr__.<locals>.<lambda>   s   €  t€ r   r   )r   Úattrs     r   Ú__getattr__zDoNothing.__getattr__   s   € Ø+Ð+Ð+r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r	   r	      s<   € € € € € ðð ðð ð ð,ð ,ð ,ð ,ð ,r   r	   c                   ó    — e Zd ZdZe€dZd„ ZdS )Ú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.c                 ól  ‡—  G d„ dt           j        ¦  «        }g Š G ˆfd„dt          ¦  «        } | |¦   «         dt          ¦   «         ¬¦  «        }|                      ‰dg¦  «         t          t          ¦   «         ¦  «        }|                     |¦  «         |                      ‰dd|fg¦  «         d	S )
zr
        C{connectionMade} and C{connectionLost} are called on the protocol by
        the C{SerialPort}.
        c                   ó   — e Zd ZeZd„ ZdS )ú@SerialPortTests.test_connectionMadeLost.<locals>.DummySerialPortc                 ó   — d S r   r   )r   s    r   Ú_finishPortSetupzQSerialPortTests.test_connectionMadeLost.<locals>.DummySerialPort._finishPortSetup5   s   € Ø�r   N)r   r   r   r	   Ú_serialFactoryr"   r   r   r   ÚDummySerialPortr    2   s(   € € € € € Ø&ˆNðð ð ð ð r   r$   c                   ó$   •— e Zd Zˆ fd„Zˆ fd„ZdS )ú?SerialPortTests.test_connectionMadeLost.<locals>.SerialProtocolc                 ó2   •— ‰                      d¦  «         d S )NÚconnectionMade©Úappend)r   Úeventss    €r   r(   zNSerialPortTests.test_connectionMadeLost.<locals>.SerialProtocol.connectionMade;   s   ø€ Ø—’Ð.Ñ/Ô/Ð/Ð/Ð/r   c                 ó6   •— ‰                      d|f¦  «         d S )NÚconnectionLostr)   )r   Úreasonr+   s     €r   r-   zNSerialPortTests.test_connectionMadeLost.<locals>.SerialProtocol.connectionLost>   s!   ø€ Ø—’Ð/°Ð8Ñ9Ô9Ð9Ð9Ð9r   N)r   r   r   r(   r-   )r+   s   €r   ÚSerialProtocolr&   :   sG   ø€ € € € € ð0ð 0ð 0ð 0ð 0ð:ð :ð :ð :ð :ð :ð :r   r/   Ú )Úreactorr(   r-   N)r   Ú
SerialPortr   r	   ÚassertEqualr   r   r-   )r   r$   r/   ÚportÚfr+   s        @r   Útest_connectionMadeLostz'SerialPortTests.test_connectionMadeLost+   sú   ø€ ð	ð 	ð 	ð 	ð 	�jÔ3ñ 	ô 	ð 	ð ˆð	:ð 	:ð 	:ð 	:ð 	:ð 	:ð 	:�Xñ 	:ô 	:ð 	:ð ˆ˜~˜~Ñ/Ô/°½Y¹[¼[ÐIÑIÔIˆØ×Ò˜Ð"2Ð!3Ñ4Ô4Ð4õ •NÑ$Ô$Ñ%Ô%ˆØ×Ò˜AÑÔÐØ×Ò˜Ð"2Ð5EÀqÐ4IÐ!JÑKÔKÐKÐKÐKr   )r   r   r   r   r   Úskipr6   r   r   r   r   r   !   s?   € € € € € ðð ð ÐØ6ˆðLð Lð Lð Lð Lr   r   )r   Útwisted.internet.errorr   Útwisted.internet.protocolr   Útwisted.python.failurer   Útwisted.trialr   Útwisted.internetr   Ú_serialportÚImportErrorr	   ÚTestCaser   r   r   r   ú<module>r@      s  ððð ð 2Ð 1Ð 1Ð 1Ð 1Ð 1Ø .Ð .Ð .Ð .Ð .Ð .Ø *Ð *Ð *Ð *Ð *Ð *Ø "Ð "Ð "Ð "Ð "Ð "ðØ:Ð:Ð:Ð:Ð:Ð:ð €J€Jøð ð ð ð Ø€J€J€Jðøøøð	,ð 	,ð 	,ð 	,ð 	,ñ 	,ô 	,ð 	,ð'Lð 'Lð 'Lð 'Lð 'L�hÔ'ñ 'Lô 'Lð 'Lð 'Lð 'Ls   œ% ¥/®/