diff options
author | Maximilian Hils <git@maximilianhils.com> | 2013-12-15 02:51:35 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2013-12-15 02:51:35 +0100 |
commit | 6ec2e6f24f2e64854e80d81c04ae44c094486821 (patch) | |
tree | d2f4110dbf52aae30da1689348eef25f0aa92f78 /test | |
parent | 605950bfdf221854b2b0fc4b875777891d90f34b (diff) | |
download | mitmproxy-6ec2e6f24f2e64854e80d81c04ae44c094486821.tar.gz mitmproxy-6ec2e6f24f2e64854e80d81c04ae44c094486821.tar.bz2 mitmproxy-6ec2e6f24f2e64854e80d81c04ae44c094486821.zip |
fix script path error in tests
Diffstat (limited to 'test')
-rw-r--r-- | test/scripts/concurrent_decorator_err.py | 5 | ||||
-rw-r--r-- | test/test_script.py | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/test/scripts/concurrent_decorator_err.py b/test/scripts/concurrent_decorator_err.py new file mode 100644 index 00000000..78191315 --- /dev/null +++ b/test/scripts/concurrent_decorator_err.py @@ -0,0 +1,5 @@ +from libmproxy.script import concurrent + +@concurrent +def start(context, argv): + pass
\ No newline at end of file diff --git a/test/test_script.py b/test/test_script.py index 296ec828..766cfb8c 100644 --- a/test/test_script.py +++ b/test/test_script.py @@ -97,7 +97,7 @@ class TestScript: def test_concurrent2(self): ctx = TScriptContext() - s = script.Script(["scripts/concurrent_decorator.py"], ctx) + s = script.Script([tutils.test_data.path("scripts/concurrent_decorator.py")], ctx) s.load() f = tutils.tflow_full() f.error = tutils.terr(f.request) @@ -109,4 +109,11 @@ class TestScript: print s.run("clientdisconnect", f) print s.run("serverconnect", f) time.sleep(0.1) - assert ctx.count == 5
\ No newline at end of file + assert ctx.count == 5 + + def test_concurrent_err(self): + s = script.Script([tutils.test_data.path("scripts/concurrent_decorator_err.py")], TScriptContext()) + tutils.raises( + "decorator not supported for this method", + s.load + )
\ No newline at end of file |