'Test pause inside data receiving. It uses fake clock to see if
pausing/resuming work.'

def test_pausing(self):

    for packet_size in range(1, 10):
        t = proto_helpers.StringIOWithoutClosing()
        clock = task.Clock()
        a = LineTester(clock)
        a.makeConnection(protocol.FileWrapper(t))
        for i in range(((len(self.pauseBuf) // packet_size) + 1)):
            s = self.pauseBuf[(i * packet_size):((i + 1) * packet_size)]
            a.dataReceived(s)
        self.assertEqual(self.pauseOutput1, a.received)
        clock.advance(0)
        self.assertEqual(self.pauseOutput2, a.received)
