ϪfddlmZddlmZmZddlmZddlmZeejGddZ GddejZ y ) ) implementer)ethernetraw) components)unittestceZdZdZdZdZy) MyProtocolc$t||_y)N)list expecting)selfr s A/usr/lib/python3/dist-packages/twisted/pair/test/test_ethernet.py__init__zMyProtocol.__init__ s icy)z! Not implemented N)r numprotos raddProtozMyProtocol.addProtosrc|jsJd|jjd}t}||||d}|||fk(sJdj|||fy)Nz(Got a packet when not expecting anymore.rpartialdestsourceprotocolzExpected {!r}, got {!r})r poplocalsformat) r datarrrrexpectlocalVariablesparamss rdatagramReceivedzMyProtocol.datagramReceivedst~~III~##A&   $' )B)I)I T6N*  'rN)__name__ __module__ __qualname__rrr#rrrr r s)  rr cBeZdZdZdZdZdZdZdZdZ dZ d Z y ) EthernetTestsctj}tddddddfg}|jd||j dd|j rJd |j zy) Nfoobarr123456987654r123456987654foobarr5Should not expect any more packets, but still want %rrEthernetProtocolr rr#r r rp1s rtestPacketParsingzEthernetTests.testPacketParsing$s))+ #$ )"+$*     vr" s r testDemuxingzEthernetTests.testDemuxingsN))+ #$ )"+$* #$ )"+$*   , vr" #$ )"+$* #$ )"+$*   , vr"  *!!UV V  vvEE < A AA ctj} |jdtgt d#t $r}|j dk(rnYd}~yd}~wwxYw)=2**16 raises an exception.irHz"Added protocol must fit in 16 bitsNrPrKs rtestAddingBadProtos_TooBigz(EthernetTests.testAddingBadProtos_TooBigs`  % % ' W JJujn -!!UV V  vv@@ rTctj} |jdtgt d#t $r}|j dk(rnYd}~yd}~wwxYw)rVirHrWNrPrKs rtestAddingBadProtos_TooBig2z)EthernetTests.testAddingBadProtos_TooBig2s`  % % ' W JJy*R. 1!!UV V  vv@@ rTN) r$r%r&r5r<r@rBrDrMrSrXrZrrrr(r(#s7 . B, \G< |W W W Wrr(N) zope.interfacer twisted.pairrrtwisted.pythonr twisted.trialrIRawPacketProtocolr TestCaser(rrrrasM'&%" S # #$  % 0\WH%%\Wr