def test_getwriter(self):
        """
        C{codecs.getwriter('imap4-utf-7')} returns the I{imap4-utf-7} stream
        writer class.
        """
        output = BytesIO()
        writer = codecs.getwriter('imap4-utf-7')(output)
        writer.write(u'Hello\xffworld')
        self.assertEqual(output.getvalue(), b'Hello&AP8-world')

        C{codecs.getwriter('imap4-utf-7')} returns the I{imap4-utf-7} stream
        writer class.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py