def test_commandRaisesIllegalClientResponse(self):
        """
        When a command raises L{IllegalClientResponse}, the
        server sends a C{BAD} response.
        """
        self.assertCommandExceptionResponse(
            imap4.IllegalClientResponse("client response"),
            b"001", b"BAD Illegal syntax: client response\r\n",
        )

        When a command raises L{IllegalClientResponse}, the
        server sends a C{BAD} response.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py