aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_script.py5
-rw-r--r--test/mitmproxy/proxy/test_server.py4
-rw-r--r--test/mitmproxy/test_certs.py2
-rw-r--r--test/pathod/test_pathod.py2
4 files changed, 7 insertions, 6 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py
index aa7ca68e..c4fe6b43 100644
--- a/test/mitmproxy/addons/test_script.py
+++ b/test/mitmproxy/addons/test_script.py
@@ -7,6 +7,7 @@ import pytest
from mitmproxy import addonmanager
from mitmproxy import exceptions
+from mitmproxy import log
from mitmproxy.addons import script
from mitmproxy.test import taddons
from mitmproxy.test import tflow
@@ -50,7 +51,7 @@ def test_load_fullname():
def test_script_print_stdout():
with taddons.context() as tctx:
- with mock.patch('mitmproxy.ctx.log.warn') as mock_warn:
+ with mock.patch('mitmproxy.ctx.master.tell') as mock_warn:
with addonmanager.safecall():
ns = script.load_script(
tutils.test_data.path(
@@ -58,7 +59,7 @@ def test_script_print_stdout():
)
)
ns.load(addonmanager.Loader(tctx.master))
- mock_warn.assert_called_once_with("stdoutprint")
+ mock_warn.assert_called_once_with("log", log.LogEntry("stdoutprint", "warn"))
class TestScript:
diff --git a/test/mitmproxy/proxy/test_server.py b/test/mitmproxy/proxy/test_server.py
index affdf221..8dce9bcd 100644
--- a/test/mitmproxy/proxy/test_server.py
+++ b/test/mitmproxy/proxy/test_server.py
@@ -479,7 +479,7 @@ class TestHTTPSNoCommonName(tservers.HTTPProxyTest):
ssl = True
ssloptions = pathod.SSLOptions(
certs=[
- (b"*", tutils.test_data.path("mitmproxy/data/no_common_name.pem"))
+ ("*", tutils.test_data.path("mitmproxy/data/no_common_name.pem"))
]
)
@@ -1142,7 +1142,7 @@ class AddUpstreamCertsToClientChainMixin:
ssloptions = pathod.SSLOptions(
cn=b"example.mitmproxy.org",
certs=[
- (b"example.mitmproxy.org", servercert)
+ ("example.mitmproxy.org", servercert)
]
)
diff --git a/test/mitmproxy/test_certs.py b/test/mitmproxy/test_certs.py
index 88c49561..693bebc6 100644
--- a/test/mitmproxy/test_certs.py
+++ b/test/mitmproxy/test_certs.py
@@ -102,7 +102,7 @@ class TestCertStore:
dc = ca2.get_cert(b"foo.com", [b"sans.example.com"])
dcp = tmpdir.join("dc")
dcp.write(dc[0].to_pem())
- ca1.add_cert_file(b"foo.com", str(dcp))
+ ca1.add_cert_file("foo.com", str(dcp))
ret = ca1.get_cert(b"foo.com", [])
assert ret[0].serial == dc[0].serial
diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py
index 5f191c0d..c0011952 100644
--- a/test/pathod/test_pathod.py
+++ b/test/pathod/test_pathod.py
@@ -57,7 +57,7 @@ class TestNotAfterConnect(tservers.DaemonTests):
class TestCustomCert(tservers.DaemonTests):
ssl = True
ssloptions = dict(
- certs=[(b"*", tutils.test_data.path("pathod/data/testkey.pem"))],
+ certs=[("*", tutils.test_data.path("pathod/data/testkey.pem"))],
)
def test_connect(self):