Add test for error (~e)

This commit is contained in:
Shadab Zafar 2016-07-12 11:56:57 +05:30
parent 17305643bc
commit 88671c3aac

View File

@ -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"""