'L{ChunkedEncoder.registerProducer} registers the given streaming
producer with its transport and L{ChunkedEncoder.unregisterProducer}
writes a zero-length chunk to its transport and unregisters the
transport\'s producer.'

def test_producerRegistration(self):

    transport = StringTransport()
    producer = object()
    encoder = ChunkedEncoder(transport)
    encoder.registerProducer(producer, True)
    self.assertIdentical(transport.producer, producer)
    self.assertTrue(transport.streaming)
    encoder.unregisterProducer()
    self.assertIdentical(transport.producer, None)
    self.assertEqual(transport.value(), '0\r\n\r\n')
