'Connect a couple protocol/transport pairs to an L{IOPump} and then pump
it.  Verify that a streaming producer registered with one of the
transports does not receive invalid L{IPushProducer} method calls and
ends in the right state.
@param mode: C{u"server"} to test a producer registered with the
server transport.  C{u"client"} to test a producer registered with
the client transport.'

def _testStreamingProducer(self, mode):

    serverProto = Protocol()
    serverTransport = FakeTransport(serverProto, isServer=True)
    clientProto = Protocol()
    clientTransport = FakeTransport(clientProto, isServer=False)
    pump = connect(serverProto, serverTransport, clientProto, clientTransport, greet=False)
    producer = StrictPushProducer()
    victim = {u'server': serverTransport, u'client': clientTransport}[mode]
    victim.registerProducer(producer, streaming=True)
    pump.pump()
    self.assertEqual(u'running', producer._state)
