diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-12-01 10:36:18 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-12-04 11:04:06 +0100 |
commit | 1a36efbb6a2d689aaf05c6d7dd614072fd7d6c1c (patch) | |
tree | 4f70b854bffc2d9ad5bc6092b9e5d774bbb29d15 /test/pathod/test_protocols_http2.py | |
parent | 741c2b7b66cbfb60cdf466063cdba3972b2ce2ee (diff) | |
download | mitmproxy-1a36efbb6a2d689aaf05c6d7dd614072fd7d6c1c.tar.gz mitmproxy-1a36efbb6a2d689aaf05c6d7dd614072fd7d6c1c.tar.bz2 mitmproxy-1a36efbb6a2d689aaf05c6d7dd614072fd7d6c1c.zip |
simplify ALPN and OpenSSL on macOS
Diffstat (limited to 'test/pathod/test_protocols_http2.py')
-rw-r--r-- | test/pathod/test_protocols_http2.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/pathod/test_protocols_http2.py b/test/pathod/test_protocols_http2.py index d77702a3..8531887b 100644 --- a/test/pathod/test_protocols_http2.py +++ b/test/pathod/test_protocols_http2.py @@ -11,6 +11,8 @@ from ..mitmproxy.net import tservers as net_tservers from pathod.protocols.http2 import HTTP2StateProtocol, TCPHandler +from ..conftest import requires_alpn + class TestTCPHandlerWrapper: def test_wrapped(self): @@ -66,37 +68,35 @@ class TestProtocol: assert mock_server_method.called +@requires_alpn class TestCheckALPNMatch(net_tservers.ServerTestBase): handler = EchoHandler ssl = dict( alpn_select=b'h2', ) - if tcp.HAS_ALPN: - - def test_check_alpn(self): - c = tcp.TCPClient(("127.0.0.1", self.port)) - with c.connect(): - c.convert_to_ssl(alpn_protos=[b'h2']) - protocol = HTTP2StateProtocol(c) - assert protocol.check_alpn() + def test_check_alpn(self): + c = tcp.TCPClient(("127.0.0.1", self.port)) + with c.connect(): + c.convert_to_ssl(alpn_protos=[b'h2']) + protocol = HTTP2StateProtocol(c) + assert protocol.check_alpn() +@requires_alpn class TestCheckALPNMismatch(net_tservers.ServerTestBase): handler = EchoHandler ssl = dict( alpn_select=None, ) - if tcp.HAS_ALPN: - - def test_check_alpn(self): - c = tcp.TCPClient(("127.0.0.1", self.port)) - with c.connect(): - c.convert_to_ssl(alpn_protos=[b'h2']) - protocol = HTTP2StateProtocol(c) - with raises(NotImplementedError): - protocol.check_alpn() + def test_check_alpn(self): + c = tcp.TCPClient(("127.0.0.1", self.port)) + with c.connect(): + c.convert_to_ssl(alpn_protos=[b'h2']) + protocol = HTTP2StateProtocol(c) + with raises(NotImplementedError): + protocol.check_alpn() class TestPerformServerConnectionPreface(net_tservers.ServerTestBase): |