aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_onboarding.py4
-rw-r--r--test/mitmproxy/test_connections.py6
-rw-r--r--test/mitmproxy/utils/test_human.py1
3 files changed, 11 insertions, 0 deletions
diff --git a/test/mitmproxy/addons/test_onboarding.py b/test/mitmproxy/addons/test_onboarding.py
index 810ddef1..0d99b1ff 100644
--- a/test/mitmproxy/addons/test_onboarding.py
+++ b/test/mitmproxy/addons/test_onboarding.py
@@ -4,6 +4,10 @@ from mitmproxy.addons import onboarding
from mitmproxy.test import taddons
from .. import tservers
+import asyncio
+import tornado.platform.asyncio
+asyncio.set_event_loop_policy(tornado.platform.asyncio.AnyThreadEventLoopPolicy())
+
class TestApp(tservers.HTTPProxyTest):
def addons(self):
diff --git a/test/mitmproxy/test_connections.py b/test/mitmproxy/test_connections.py
index 00cdbc87..845a9043 100644
--- a/test/mitmproxy/test_connections.py
+++ b/test/mitmproxy/test_connections.py
@@ -38,6 +38,9 @@ class TestClientConnection:
assert 'ALPN' not in repr(c)
assert 'TLS' in repr(c)
+ c.address = None
+ assert repr(c)
+
def test_tls_established_property(self):
c = tflow.tclient_conn()
c.tls_established = True
@@ -110,6 +113,9 @@ class TestServerConnection:
c.tls_established = False
assert 'TLS' not in repr(c)
+ c.address = None
+ assert repr(c)
+
def test_tls_established_property(self):
c = tflow.tserver_conn()
c.tls_established = True
diff --git a/test/mitmproxy/utils/test_human.py b/test/mitmproxy/utils/test_human.py
index 947cfa4a..faf35f72 100644
--- a/test/mitmproxy/utils/test_human.py
+++ b/test/mitmproxy/utils/test_human.py
@@ -56,3 +56,4 @@ def test_format_address():
assert human.format_address(("example.com", "54010")) == "example.com:54010"
assert human.format_address(("::", "8080")) == "*:8080"
assert human.format_address(("0.0.0.0", "8080")) == "*:8080"
+ assert human.format_address(None) == "<no address>"