'Check the readLimit parameter: read data and check for the pause
status.'

def test_readLimit(self):

    server = Server()
    tServer = TestableThrottlingFactory(task.Clock(), server, readLimit=10)
    port = tServer.buildProtocol(address.IPv4Address('TCP', '127.0.0.1', 0))
    tr = StringTransportWithDisconnection()
    tr.protocol = port
    port.makeConnection(tr)
    port.dataReceived('0123456789')
    port.dataReceived('abcdefghij')
    self.assertEqual(tr.value(), '0123456789abcdefghij')
    self.assertEqual(tServer.readThisSecond, 20)
    tServer.clock.advance(1.05)
    self.assertEqual(tServer.readThisSecond, 0)
    self.assertEqual(tr.producerState, 'paused')
    tServer.clock.advance(1.05)
    self.assertEqual(tServer.readThisSecond, 0)
    self.assertEqual(tr.producerState, 'producing')
    tr.clear()
    port.dataReceived('0123456789')
    port.dataReceived('abcdefghij')
    self.assertEqual(tr.value(), '0123456789abcdefghij')
    self.assertEqual(tServer.readThisSecond, 20)
    tServer.clock.advance(1.05)
    self.assertEqual(tServer.readThisSecond, 0)
    self.assertEqual(tr.producerState, 'paused')
    tServer.clock.advance(1.05)
    self.assertEqual(tServer.readThisSecond, 0)
    self.assertEqual(tr.producerState, 'producing')
