def test_credentialsInvalidResponse(self):
        """
        L{PLAINCredentials.setResponse} raises L{imap4.IllegalClientResponse}
        when passed a string not of the expected form.
        """
        cred = imap4.PLAINCredentials()
        self.assertRaises(
            imap4.IllegalClientResponse, cred.setResponse, b'hello')
        self.assertRaises(
            imap4.IllegalClientResponse, cred.setResponse, b'hello\0world')
        self.assertRaises(
            imap4.IllegalClientResponse, cred.setResponse,
            b'hello\0world\0Zoom!\0')

        L{PLAINCredentials.setResponse} raises L{imap4.IllegalClientResponse}
        when passed a string not of the expected form.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py