Add tests for TCPFlow.match

This commit is contained in:
Shadab Zafar 2016-07-15 17:02:08 +05:30
parent 6a2668d865
commit 8c49f0e784

View File

@ -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):