diff options
Diffstat (limited to 'test/test_script.py')
-rw-r--r-- | test/test_script.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/test_script.py b/test/test_script.py index 32ee2d95..94f036d9 100644 --- a/test/test_script.py +++ b/test/test_script.py @@ -1,6 +1,7 @@ import os from libmproxy import script, flow import libpry +import tutils class uScript(libpry.AutoTree): def test_simple(self): @@ -13,15 +14,25 @@ class uScript(libpry.AutoTree): assert "here" in p.ns assert p.run("here") == (True, 1) assert p.run("here") == (True, 2) - + ret = p.run("errargs") - assert not ret[0] + assert not ret[0] assert len(ret[1]) == 2 # Check reload p.load() assert p.run("here") == (True, 1) + def test_duplicate_flow(self): + s = flow.State() + fm = flow.FlowMaster(None, s) + fm.load_script(os.path.join("scripts", "duplicate_flow.py")) + r = tutils.treq() + fm.handle_request(r) + assert fm.state.flow_count() == 2 + assert not fm.state.view[0].request.is_replay() + assert fm.state.view[1].request.is_replay() + def test_err(self): s = flow.State() fm = flow.FlowMaster(None, s) |