aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/test_connections.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-04-26 11:47:07 +1200
committerGitHub <noreply@github.com>2018-04-26 11:47:07 +1200
commitb18e0fa2bcac8b55b1d8325f4a2b1f916e3c0d9b (patch)
tree332a42ef3dfd28ec0f4496b1f8ae79464f069069 /test/mitmproxy/test_connections.py
parent5546f0a05ec21db986f0639cee9e89452ba68642 (diff)
parent95e690ba31db9cb35eaa7e22ecebbe06ea8e2044 (diff)
downloadmitmproxy-b18e0fa2bcac8b55b1d8325f4a2b1f916e3c0d9b.tar.gz
mitmproxy-b18e0fa2bcac8b55b1d8325f4a2b1f916e3c0d9b.tar.bz2
mitmproxy-b18e0fa2bcac8b55b1d8325f4a2b1f916e3c0d9b.zip
Merge pull request #3071 from cortesi/tickless
asyncio: shift script reloading out of the tick event
Diffstat (limited to 'test/mitmproxy/test_connections.py')
-rw-r--r--test/mitmproxy/test_connections.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/mitmproxy/test_connections.py b/test/mitmproxy/test_connections.py
index acd98eb8..7c371c1e 100644
--- a/test/mitmproxy/test_connections.py
+++ b/test/mitmproxy/test_connections.py
@@ -10,7 +10,6 @@ from mitmproxy import exceptions
from mitmproxy.net import tcp
from mitmproxy.net.http import http1
from mitmproxy.test import tflow
-from mitmproxy.test import tutils
from .net import tservers
from pathod import test
@@ -185,7 +184,7 @@ class TestClientConnectionTLS:
None,
"example.com"
])
- def test_tls_with_sni(self, sni):
+ def test_tls_with_sni(self, sni, tdata):
address = ('127.0.0.1', 0)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@@ -206,8 +205,8 @@ class TestClientConnectionTLS:
connection, client_address = sock.accept()
c = connections.ClientConnection(connection, client_address, None)
- cert = tutils.test_data.path("mitmproxy/net/data/server.crt")
- with open(tutils.test_data.path("mitmproxy/net/data/server.key")) as f:
+ cert = tdata.path("mitmproxy/net/data/server.crt")
+ with open(tdata.path("mitmproxy/net/data/server.key")) as f:
raw_key = f.read()
key = OpenSSL.crypto.load_privatekey(
OpenSSL.crypto.FILETYPE_PEM,
@@ -230,10 +229,12 @@ class TestServerConnectionTLS(tservers.ServerTestBase):
@pytest.mark.parametrize("client_certs", [
None,
- tutils.test_data.path("mitmproxy/data/clientcert"),
- tutils.test_data.path("mitmproxy/data/clientcert/client.pem"),
+ "mitmproxy/data/clientcert",
+ "mitmproxy/data/clientcert/client.pem",
])
- def test_tls(self, client_certs):
+ def test_tls(self, client_certs, tdata):
+ if client_certs:
+ client_certs = tdata.path(client_certs)
c = connections.ServerConnection(("127.0.0.1", self.port))
c.connect()
c.establish_tls(client_certs=client_certs)