'L{ChunkedEncoder.write} writes to the transport the chunked encoded
form of the bytes passed to it.'

def test_write(self):

    transport = StringTransport()
    encoder = ChunkedEncoder(transport)
    encoder.write('foo')
    self.assertEqual(transport.value(), '3\r\nfoo\r\n')
    transport.clear()
    encoder.write(('x' * 16))
    self.assertEqual(transport.value(), (('10\r\n' + ('x' * 16)) + '\r\n'))
