def test_http2_absent(self):
        """
        If the transport reports that HTTP/2 is negotiated and HTTP/2 is not
        present, an error is encountered.
        """
        b = StringTransport()
        b.negotiatedProtocol = b'h2'
        self.assertRaises(
            ValueError,
            self._negotiatedProtocolForTransportInstance,
            b,
        )

        If the transport reports that HTTP/2 is negotiated and HTTP/2 is not
        present, an error is encountered.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py