'The L{_GenericHTTPChannelProtocol} will unregister its proxy channel
from the transport if upgrade is negotiated.'

def test_unregistersProducer(self):

    transport = StringTransport()
    transport.negotiatedProtocol = 'h2'
    genericProtocol = http._genericHTTPChannelProtocolFactory('')
    genericProtocol.requestFactory = DummyHTTPHandlerProxy
    genericProtocol.makeConnection(transport)
    self.assertIs(transport.producer, genericProtocol._channel)
    genericProtocol.dataReceived('P')
    self.assertIs(transport.producer, None)
