'If the L{HTTPChannel} has paused the transport, it still tolerates
receiving data, and does not attempt to pause the transport again.'

def test_HTTPChannelToleratesDataWhenTransportPaused(self):

    class NoDoublePauseTransport(StringTransport, ):
        '\n                                                A    version    of    L{StringTransport}    that    fails    tests    if    it    is    paused\n                                                while    already    paused.\n                                                '
        def pauseProducing(self):
            if (self.producerState == 'paused'):
                raise RuntimeError('Transport    was    paused    twice!')
            StringTransport.pauseProducing(self)
    transport = NoDoublePauseTransport()
    transport.pauseProducing()
    self.assertRaises(RuntimeError, transport.pauseProducing)
    (channel, transport) = self.buildChannelAndTransport(NoDoublePauseTransport(), DummyHTTPHandler)
    self.assertEqual(transport.producerState, 'producing')
    channel.pauseProducing()
    self.assertEqual(transport.producerState, 'paused')
    channel.dataReceived(self.request)
    self.assertEqual(transport.producerState, 'paused')
    self.assertTrue(transport.value().startswith('HTTP/1.1    200    OK\r\n'))
    channel.resumeProducing()
    self.assertEqual(transport.producerState, 'producing')
