From 1a36efbb6a2d689aaf05c6d7dd614072fd7d6c1c Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Thu, 1 Dec 2016 10:36:18 +0100 Subject: simplify ALPN and OpenSSL on macOS --- test/pathod/test_pathod.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/pathod/test_pathod.py') diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py index 6a4e1c62..1e34af23 100644 --- a/test/pathod/test_pathod.py +++ b/test/pathod/test_pathod.py @@ -1,11 +1,14 @@ import io +import pytest + from pathod import pathod from mitmproxy.net import tcp from mitmproxy import exceptions from mitmproxy.test import tutils from . import tservers +from ..conftest import requires_alpn class TestPathod: @@ -257,8 +260,11 @@ class TestHTTP2(tservers.DaemonTests): ssl = True nohang = True - if tcp.HAS_ALPN: + @requires_alpn + def test_http2(self): + r, _ = self.pathoc(["GET:/"], ssl=True, use_http2=True) + assert r[0].status_code == 800 - def test_http2(self): + def test_no_http2(self, disable_alpn): + with pytest.raises(NotImplementedError): r, _ = self.pathoc(["GET:/"], ssl=True, use_http2=True) - assert r[0].status_code == 800 -- cgit v1.2.3