mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Add tests for TCPFlow.match
This commit is contained in:
parent
6a2668d865
commit
8c49f0e784
@ -293,7 +293,7 @@ class TestServerPlaybackState:
|
|||||||
assert s._hash(r) == s._hash(r2)
|
assert s._hash(r) == s._hash(r2)
|
||||||
|
|
||||||
|
|
||||||
class TestFlow(object):
|
class TestHTTPFlow(object):
|
||||||
|
|
||||||
def test_copy(self):
|
def test_copy(self):
|
||||||
f = tutils.tflow(resp=True)
|
f = tutils.tflow(resp=True)
|
||||||
@ -443,6 +443,20 @@ class TestFlow(object):
|
|||||||
assert f.response.content == b"abarb"
|
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:
|
class TestState:
|
||||||
|
|
||||||
def test_backup(self):
|
def test_backup(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user