diff options
author | kira0204 <rshtmudgal@gmail.com> | 2018-03-07 13:18:19 +0530 |
---|---|---|
committer | kira0204 <rshtmudgal@gmail.com> | 2018-03-07 13:18:19 +0530 |
commit | b8fbe71c93866cd59a2193d9ecac369b141128fd (patch) | |
tree | d42a08d12d3c4576dcc74423336c574929c70a55 /test | |
parent | c6802ba034d859a914bebddaa9e3214e15206d0e (diff) | |
download | mitmproxy-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.py | 12 |
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() |