'When the streaming producer is paused, the underlying producer stops
getting resumeProducing calls.'

def test_pause(self):

    class PausingStringTransport(StringTransport, ):
        writes = 0
        def __init__(self):
            StringTransport.__init__(self)
            self.paused = Deferred()
        def write(self, data):
            self.writes += 1
            StringTransport.write(self, data)
            if (self.writes == 3):
                self.producer.pauseProducing()
                d = self.paused
                del self.paused
                d.callback(None)
    consumer = PausingStringTransport()
    nsProducer = NonStreamingProducer(consumer)
    streamingProducer = _PullToPush(nsProducer, consumer)
    consumer.registerProducer(streamingProducer, True)
    def shouldNotBeCalled(ignore):
        self.fail('BUG:    The    producer    should    not    finish!')
    nsProducer.result.addCallback(shouldNotBeCalled)
    done = consumer.paused
    def paused(ignore):
        self.assertEqual(streamingProducer._coopTask._pauseCount, 1)
    done.addCallback(paused)
    streamingProducer.startStreaming()
    return done
