'L{StringTransport.registerProducer} raises L{RuntimeError} if a
producer is already registered.'

def test_disallowedRegisterProducer(self):

    producer = object()
    self.transport.registerProducer(producer, True)
    self.assertRaises(RuntimeError, self.transport.registerProducer, object(), False)
    self.assertIs(self.transport.producer, producer)
    self.assertTrue(self.transport.streaming)
