diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-02-16 14:33:04 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-02-16 14:33:04 +1300 |
commit | 0c6f846861f537e5ebf61a1c3ac536ca04fa5892 (patch) | |
tree | 5fbf3d92b4134ec32b3f0ea73e7d71333fa80e3d /test/test_flow.py | |
parent | 5692c7359c7c468e1ee35f9bdd3b7b92fd67592c (diff) | |
download | mitmproxy-0c6f846861f537e5ebf61a1c3ac536ca04fa5892.tar.gz mitmproxy-0c6f846861f537e5ebf61a1c3ac536ca04fa5892.tar.bz2 mitmproxy-0c6f846861f537e5ebf61a1c3ac536ca04fa5892.zip |
First draft of the new serialization mechanism.
Diffstat (limited to 'test/test_flow.py')
-rw-r--r-- | test/test_flow.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_flow.py b/test/test_flow.py index b71ce6af..4dfa059e 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -1,3 +1,4 @@ +from cStringIO import StringIO from libmproxy import console, proxy, filt, flow import utils import libpry @@ -249,8 +250,24 @@ class uState(libpry.AutoTree): c.accept_all() +class uSerialize(libpry.AutoTree): + def test_roundtrip(self): + sio = StringIO() + f = utils.tflow() + w = flow.FlowWriter(sio) + w.add(f) + + sio.seek(0) + r = flow.FlowReader(sio) + l = list(r.stream()) + assert len(l) == 1 + assert l[0] == f + + + tests = [ uFlow(), uState(), + uSerialize() ] |