diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-02-15 14:58:49 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-02-15 14:58:49 +0100 |
commit | 175ce43a30559115c08e41e5d87519e957ff96f6 (patch) | |
tree | 9231c6396d15b70601492458b33f44bfe579233b /pathod/test/test_log.py | |
parent | 43c3e164ecf13b2d0909f748c2c61f39e197659e (diff) | |
parent | e8598f5f7a613d7d27130de970b4c0045b3ee0d1 (diff) | |
download | mitmproxy-175ce43a30559115c08e41e5d87519e957ff96f6.tar.gz mitmproxy-175ce43a30559115c08e41e5d87519e957ff96f6.tar.bz2 mitmproxy-175ce43a30559115c08e41e5d87519e957ff96f6.zip |
add pathod
Diffstat (limited to 'pathod/test/test_log.py')
-rw-r--r-- | pathod/test/test_log.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pathod/test/test_log.py b/pathod/test/test_log.py new file mode 100644 index 00000000..8f38c040 --- /dev/null +++ b/pathod/test/test_log.py @@ -0,0 +1,25 @@ +import StringIO +from libpathod import log +from netlib.exceptions import TcpDisconnect +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() + l = log.ConnectionLogger(outf, False, rw, rw) + try: + with l.ctx() as lg: + lg("Test") + except TcpDisconnect: + pass + assert "Test" in outf.getvalue() |