ϪfdZddlmZddlmZddlmZddlmZ ddl m Z e Z Gdd Z Gd d ejZy#e $rdZ Y)wxYw) z+ Tests for L{twisted.internet.serialport}. )ConnectionDone)Protocol)Failure)unittest) serialportNceZdZdZdZdZy) DoNothingz. Object with methods that do nothing. cyN)selfargskwargss G/usr/lib/python3/dist-packages/twisted/internet/test/test_serialport.py__init__zDoNothing.__init__s cdS)Ncyr r )rrs rz'DoNothing.__getattr__..srr )r attrs r __getattr__zDoNothing.__getattr__s++rN)__name__ __module__ __qualname____doc__rrr rrr r s ,rr ceZdZdZedZdZy)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(Gddtj}gGfddt}||dt}|j dgt t }|j||j dd|fgy ) zr C{connectionMade} and C{connectionLost} are called on the protocol by the C{SerialPort}. ceZdZeZdZy)@SerialPortTests.test_connectionMadeLost..DummySerialPortcyr r )r s r_finishPortSetupzQSerialPortTests.test_connectionMadeLost..DummySerialPort._finishPortSetup5srN)rrrr _serialFactoryr"r rrDummySerialPortr 2s &N rr$c"eZdZfdZfdZy)?SerialPortTests.test_connectionMadeLost..SerialProtocolc(jdy)NconnectionMadeappend)r eventss rr(zNSerialPortTests.test_connectionMadeLost..SerialProtocol.connectionMade;s ./rc,jd|fy)NconnectionLostr))r reasonr+s rr-zNSerialPortTests.test_connectionMadeLost..SerialProtocol.connectionLost>s /89rN)rrrr(r-)r+srSerialProtocolr&:s  0 :rr/)reactorr(r-N)r SerialPortrr assertEqualrrr-)r r$r/portfr+s @rtest_connectionMadeLostz'SerialPortTests.test_connectionMadeLost+s j33   :X :~/Y[I "2!34 N$ % A "25Eq4I!JKr)rrrrrskipr6r rrrr!s 6Lrr)rtwisted.internet.errorrtwisted.internet.protocolrtwisted.python.failurer twisted.trialrtwisted.internetr _serialport ImportErrorr TestCaserr rrr@s[2.*":J , ,'Lh'''L%JsAA A