def test_fetchParserMissingSectionClose(self):
        """
        Parsing a C{BODY} with an unterminated section list raises an
        L{Exception}.
        """
        p = imap4._FetchParser()
        self.assertRaises(Exception,
                          p.parseString, b'BODY[HEADER')
        p = imap4._FetchParser()
        self.assertRaises(Exception,
                          p.parseString, b'BODY[HEADER.FIELDS (SUBJECT)')

        Parsing a C{BODY} with an unterminated section list raises an
        L{Exception}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py