diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-06-04 20:36:50 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-06-04 20:36:50 +1200 |
commit | 07d5b90ebf190c4419f6b3f3d3cea1cf116ceecb (patch) | |
tree | 3a27d3c3e0b4985368fcd3a8153924c497162fbd /test/test_log.py | |
parent | 182b79ab9ec3f59e17536b135e90eaa91e577111 (diff) | |
download | mitmproxy-07d5b90ebf190c4419f6b3f3d3cea1cf116ceecb.tar.gz mitmproxy-07d5b90ebf190c4419f6b3f3d3cea1cf116ceecb.tar.bz2 mitmproxy-07d5b90ebf190c4419f6b3f3d3cea1cf116ceecb.zip |
Shore up test suite.
Diffstat (limited to 'test/test_log.py')
-rw-r--r-- | test/test_log.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_log.py b/test/test_log.py new file mode 100644 index 00000000..5473236e --- /dev/null +++ b/test/test_log.py @@ -0,0 +1,22 @@ +import StringIO +from libpathod import log +import netlib.tcp + + +class DummyIO(StringIO.StringIO): + def start_log(self, *args, **kwargs): + pass + + def get_log(self, *args, **kwargs): + return "" + + +def test_disconnect(): + outf = DummyIO() + rw = DummyIO() + try: + with log.Log(outf, False, rw, rw) as lg: + raise netlib.tcp.NetLibDisconnect() + except netlib.tcp.NetLibDisconnect: + pass + assert "Disconnected" in outf.getvalue() |