aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-07-12 11:56:57 +0530
committerShadab Zafar <dufferzafar0@gmail.com>2016-07-16 10:15:38 +0530
commit88671c3aac430dfac8a609c82123b138ded22fad (patch)
tree07c6611d63412322f77f2993c8537cae89fb7cc5 /test
parent17305643bc482c0b185eec5c64d506790cd26587 (diff)
downloadmitmproxy-88671c3aac430dfac8a609c82123b138ded22fad.tar.gz
mitmproxy-88671c3aac430dfac8a609c82123b138ded22fad.tar.bz2
mitmproxy-88671c3aac430dfac8a609c82123b138ded22fad.zip
Add test for error (~e)
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_filt.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/mitmproxy/test_filt.py b/test/mitmproxy/test_filt.py
index 9fe36b2a..f6c08c67 100644
--- a/test/mitmproxy/test_filt.py
+++ b/test/mitmproxy/test_filt.py
@@ -73,7 +73,7 @@ class TestParsing:
self._dump(a)
-class TestMatching:
+class TestMatchingHTTPFlow:
def req(self):
return tutils.tflow()
@@ -247,6 +247,21 @@ class TestMatching:
assert not self.q("!~c 201 !~c 200", s)
+class TestMatchingTCPFlow:
+
+ def flow(self):
+ return tutils.ttcpflow()
+
+ def err(self):
+ return tutils.ttcpflow(err=True)
+
+ def q(self, q, o):
+ return filt.parse(q)(o)
+
+ def test_ferr(self):
+ e = self.err()
+ assert self.q("~e", e)
+
@patch('traceback.extract_tb')
def test_pyparsing_bug(extract_tb):
"""https://github.com/mitmproxy/mitmproxy/issues/1087"""