aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/mitmproxy/test_flow.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py
index c58a9703..67aa1302 100644
--- a/test/mitmproxy/test_flow.py
+++ b/test/mitmproxy/test_flow.py
@@ -293,7 +293,7 @@ class TestServerPlaybackState:
assert s._hash(r) == s._hash(r2)
-class TestFlow(object):
+class TestHTTPFlow(object):
def test_copy(self):
f = tutils.tflow(resp=True)
@@ -443,6 +443,20 @@ class TestFlow(object):
assert f.response.content == b"abarb"
+class TestTCPFlow:
+
+ def test_match(self):
+ f = tutils.ttcpflow()
+ assert not f.match("~b nonexistent")
+ assert f.match(None)
+ assert not f.match("~b nonexistent")
+
+ f = tutils.ttcpflow(err=True)
+ assert f.match("~e")
+
+ tutils.raises(ValueError, f.match, "~")
+
+
class TestState:
def test_backup(self):