def test_write(self):
        """
        L{ChunkedEncoder.write} writes to the transport the chunked encoded
        form of the bytes passed to it.
        """
        transport = StringTransport()
        encoder = ChunkedEncoder(transport)
        encoder.write(b'foo')
        self.assertEqual(transport.value(), b'3\r\nfoo\r\n')
        transport.clear()
        encoder.write(b'x' * 16)
        self.assertEqual(transport.value(), b'10\r\n' + b'x' * 16 + b'\r\n')

        L{ChunkedEncoder.write} writes to the transport the chunked encoded
        form of the bytes passed to it.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_newclient.py