diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-02-10 15:22:26 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-02-10 15:22:26 +1300 |
commit | 5f785e26b9b863d5ab340e0299ae31753cc84dfb (patch) | |
tree | bec911e6e30f0b8484759f415600db0d9d751eba /test | |
parent | b14c29b25c4c5754edf568bcbb6bbf5b70b6c310 (diff) | |
download | mitmproxy-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')
-rw-r--r-- | test/test_filt.py | 10 |
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() |