diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-21 14:29:49 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-21 14:29:49 +1200 |
commit | 12c140b951705c08131cc4b86a247bccc9c493c0 (patch) | |
tree | a7f46e120bb5d522b59736861cfd89cafb18cc13 /test/test_pathod.py | |
parent | 1089a52f3d16c4fef504586cae18a5d324e8d75c (diff) | |
download | mitmproxy-12c140b951705c08131cc4b86a247bccc9c493c0.tar.gz mitmproxy-12c140b951705c08131cc4b86a247bccc9c493c0.tar.bz2 mitmproxy-12c140b951705c08131cc4b86a247bccc9c493c0.zip |
Restore client argument parsing. Add thread-safe logging subsystem.
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r-- | test/test_pathod.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py index 36a2d090..9c16748d 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -31,5 +31,17 @@ class _TestApplication: class TestPathod: def test_instantiation(self): - pathod.Pathod(("127.0.0.1", 0)) - + p = pathod.Pathod(("127.0.0.1", 0)) + + def test_logging(self): + p = pathod.Pathod(("127.0.0.1", 0)) + assert len(p.get_log()) == 0 + id = p.add_log(dict(s="foo")) + assert p.log_by_id(id) + assert len(p.get_log()) == 1 + p.clear_log() + assert len(p.get_log()) == 0 + + for i in range(p.LOGBUF + 1): + p.add_log(dict(s="foo")) + assert len(p.get_log()) <= p.LOGBUF |