'L{H2Connection} can be stopped by its producer. That causes it to lose
its transport.'

def test_stopProducing(self):

    f = FrameFactory()
    b = StringTransport()
    a = H2Connection()
    a.requestFactory = DummyHTTPHandlerProxy
    frames = buildRequestFrames(self.getRequestHeaders, [], f)
    requestBytes = f.clientConnectionPreface()
    requestBytes += ''.join((f.serialize() for f in frames))
    a.makeConnection(b)
    b.registerProducer(a, True)
    for byte in iterbytes(requestBytes):
        a.dataReceived(byte)
    a.stopProducing()
    frames = framesFromBytes(b.value())
    self.assertEqual(len(frames), 2)
    self.assertFalse(isinstance(frames[(-1)], hyperframe.frame.DataFrame))
    self.assertFalse(a._stillProducing)
