aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_filt.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-02-10 15:22:26 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-02-10 15:22:26 +1300
commit5f785e26b9b863d5ab340e0299ae31753cc84dfb (patch)
treebec911e6e30f0b8484759f415600db0d9d751eba /test/test_filt.py
parentb14c29b25c4c5754edf568bcbb6bbf5b70b6c310 (diff)
downloadmitmproxy-5f785e26b9b863d5ab340e0299ae31753cc84dfb.tar.gz
mitmproxy-5f785e26b9b863d5ab340e0299ae31753cc84dfb.tar.bz2
mitmproxy-5f785e26b9b863d5ab340e0299ae31753cc84dfb.zip
Add filter for detecting flows with errors.
Also, remove dependency on weird _is_response method.
Diffstat (limited to 'test/test_filt.py')
-rw-r--r--test/test_filt.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_filt.py b/test/test_filt.py
index 4ff7e90e..dfb2b3e1 100644
--- a/test/test_filt.py
+++ b/test/test_filt.py
@@ -9,7 +9,7 @@ class uParsing(libpry.AutoTree):
x.dump(fp=c)
assert c.getvalue()
- def test_err(self):
+ def test_parse_err(self):
assert filt.parse("~h [") is None
def test_simple(self):
@@ -99,6 +99,10 @@ class uMatching(libpry.AutoTree):
"content_response"
)
+ def err(self):
+ q = self.req()
+ return flow.Error(q, "msg")
+
def q(self, q, o):
return filt.parse(q)(o)
@@ -132,6 +136,10 @@ class uMatching(libpry.AutoTree):
assert not self.q("~s", q)
assert self.q("~s", s)
+ def test_ferr(self):
+ e = self.err()
+ assert self.q("~e", e)
+
def test_head(self):
q = self.req()
s = self.resp()