aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-01-12 13:59:32 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-01-12 13:59:32 +1300
commite5776b8be3ea36c065beabe416506871f34892e6 (patch)
tree46da3faa0648588ac60d66b0430f06b06be7fc78 /test
parent58e1b3a47f392a5f4f16e30318820f163568f54e (diff)
downloadmitmproxy-e5776b8be3ea36c065beabe416506871f34892e6.tar.gz
mitmproxy-e5776b8be3ea36c065beabe416506871f34892e6.tar.bz2
mitmproxy-e5776b8be3ea36c065beabe416506871f34892e6.zip
Clean up and clarify script API
Diffstat (limited to 'test')
-rw-r--r--test/test_script.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/test_script.py b/test/test_script.py
index 69386834..2664b840 100644
--- a/test/test_script.py
+++ b/test/test_script.py
@@ -41,28 +41,24 @@ class TestScript:
s = flow.State()
fm = flow.FlowMaster(None, s)
- s = script.Script(["nonexistent"], fm)
tutils.raises(
"no such file",
- s.load
+ script.Script, ["nonexistent"], fm
)
- s = script.Script([tutils.test_data.path("scripts")], fm)
tutils.raises(
"not a file",
- s.load
+ script.Script, [tutils.test_data.path("scripts")], fm
)
- s = script.Script([tutils.test_data.path("scripts/syntaxerr.py")], fm)
tutils.raises(
script.ScriptError,
- s.load
+ script.Script, [tutils.test_data.path("scripts/syntaxerr.py")], fm
)
- s = script.Script([tutils.test_data.path("scripts/loaderr.py")], fm)
tutils.raises(
script.ScriptError,
- s.load
+ script.Script, [tutils.test_data.path("scripts/loaderr.py")], fm
)
def test_concurrent(self):
@@ -106,8 +102,7 @@ class TestScript:
def test_concurrent_err(self):
s = flow.State()
fm = flow.FlowMaster(None, s)
- s = script.Script([tutils.test_data.path("scripts/concurrent_decorator_err.py")], fm)
tutils.raises(
"decorator not supported for this method",
- s.load
+ script.Script, [tutils.test_data.path("scripts/concurrent_decorator_err.py")], fm
)