def test_stringLiteralTooLong(self):
        """
        A string literal whose length exceeds the maximum allowed
        length results in a C{BAD} response.
        """
        self.server._literalStringLimit = 4
        self.server.lineReceived(b"001 LOGIN {5}\r\n")

        self.assertEqual(self.transport.value(),
                         b"001 BAD Illegal syntax: Literal too long!"
                         b" I accept at most 4 octets\r\n")

        A string literal whose length exceeds the maximum allowed
        length results in a C{BAD} response.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py