def testFrameTransmitterBecomesReadyOnlyOnceTransmissionComplete(self):
     tmp = MockSink()
     sink = EscapingSink(tmp)
     transmitter = FrameTransmitter(sink)
     transmitter.transmit(FrameTransmitter.ACK() + 0x24)
     
     for i in range(0, 5):
         self.assertFalse(transmitter.isReady())
         transmitter.schedule()
         sink.schedule()
     
     self.assertTrue(transmitter.isReady())
 def testFrameTransmitterBecomesUnreadyWhenTransmitting(self):
     tmp = MockSink()
     sink = EscapingSink(tmp)
     transmitter = FrameTransmitter(sink)
     transmitter.transmit(FrameTransmitter.ACK() + 0x24)
     self.assertFalse(transmitter.isReady())
 def testFrameTransmitterIsBornReady(self):
     tmp = MockSink()
     sink = EscapingSink(tmp)
     transmitter = FrameTransmitter(sink)
     self.assertTrue(transmitter.isReady())