def test_fetchParserIncompleteStringEndsInWhitespace(self):
        """
        Parsing a string that prematurely ends in whitespace raises an
        L{Exception}.
        """
        p = imap4._FetchParser()
        self.assertRaises(Exception, p.parseString, b"BODY[HEADER.FIELDS  ")

        Parsing a string that prematurely ends in whitespace raises an
        L{Exception}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py