aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkira0204 <rshtmudgal@gmail.com>2018-03-07 13:18:19 +0530
committerkira0204 <rshtmudgal@gmail.com>2018-03-07 13:18:19 +0530
commitb8fbe71c93866cd59a2193d9ecac369b141128fd (patch)
treed42a08d12d3c4576dcc74423336c574929c70a55 /test
parentc6802ba034d859a914bebddaa9e3214e15206d0e (diff)
downloadmitmproxy-b8fbe71c93866cd59a2193d9ecac369b141128fd.tar.gz
mitmproxy-b8fbe71c93866cd59a2193d9ecac369b141128fd.tar.bz2
mitmproxy-b8fbe71c93866cd59a2193d9ecac369b141128fd.zip
User script exception handler[squash]
fixing 2837, added test unified-function deleting the wrong commit
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_script.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py
index dc21e6fd..623ed9a1 100644
--- a/test/mitmproxy/addons/test_script.py
+++ b/test/mitmproxy/addons/test_script.py
@@ -243,6 +243,18 @@ class TestScriptLoader:
tctx.invoke(sc, "tick")
assert len(tctx.master.addons) == 1
+ def test_script_error_handler(self):
+ path = "/sample/path/example.py"
+ exc = SyntaxError
+ msg = "Error raised"
+ tb = True
+ with taddons.context() as tctx:
+ script.script_error_handler(path, exc, msg, tb)
+ assert tctx.master.has_log("/sample/path/example.py")
+ assert tctx.master.has_log("Error raised")
+ assert tctx.master.has_log("lineno")
+ assert tctx.master.has_log("NoneType")
+
def test_order(self):
rec = tutils.test_data.path("mitmproxy/data/addonscripts/recorder")
sc = script.ScriptLoader()