aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-03-13 14:51:25 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-03-13 14:51:25 +1300
commit3ef9d2cffc24b86fe29357f7705015b1e66c3657 (patch)
tree21a45e53c5fcfd5d12a520343ded8a4db5ffcfc7 /test
parent18d25ec1a10c68f9e61e0416a920ca137b3dba68 (diff)
downloadmitmproxy-3ef9d2cffc24b86fe29357f7705015b1e66c3657.tar.gz
mitmproxy-3ef9d2cffc24b86fe29357f7705015b1e66c3657.tar.bz2
mitmproxy-3ef9d2cffc24b86fe29357f7705015b1e66c3657.zip
flow.py 100% test coverage
Diffstat (limited to 'test')
-rw-r--r--test/test_flow.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/test_flow.py b/test/test_flow.py
index f29e1e80..947d0d59 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -265,7 +265,7 @@ class uState(libpry.AutoTree):
e = proxy.Error(tutils.tflow().request, "message")
assert not c.add_error(e)
- def test_view(self):
+ def test_set_limit(self):
c = flow.State()
req = tutils.treq()
@@ -292,6 +292,16 @@ class uState(libpry.AutoTree):
c.set_limit("~s")
assert len(c.view) == 1
+ assert "Invalid" in c.set_limit("~")
+
+ def test_set_intercept(self):
+ c = flow.State()
+ assert not c.set_intercept("~q")
+ assert c.intercept_txt == "~q"
+ assert "Invalid" in c.set_intercept("~")
+ assert not c.set_intercept(None)
+ assert c.intercept_txt == None
+
def _add_request(self, state):
req = tutils.treq()
f = state.add_request(req)