def test_peerFromNonSSLTransport(self):
        """
        Verify that peerFromTransport raises an exception if the transport
        passed is not actually an SSL transport.
        """
        x = self.assertRaises(CertificateError,
                              sslverify.Certificate.peerFromTransport,
                              _NotSSLTransport())
        self.assertTrue(str(x).startswith("non-TLS"))

        Verify that peerFromTransport raises an exception if the transport
        passed is not actually an SSL transport.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_sslverify.py