diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_console.py | 9 | ||||
-rw-r--r-- | test/test_dump.py | 30 |
2 files changed, 35 insertions, 4 deletions
diff --git a/test/test_console.py b/test/test_console.py index 179b116d..93312824 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -105,11 +105,12 @@ class uformat_keyvals(libpry.AutoTree): class uformat_flow(libpry.AutoTree): def test_simple(self): f = utils.tflow() - assert ('focus', '>> ') not in console.format_flow(f, False) - assert ('focus', '>> ') in console.format_flow(f, True) + foc = ('focus', '>>') + assert foc not in console.format_flow(f, False) + assert foc in console.format_flow(f, True) - assert ('focus', '>> ') not in console.format_flow(f, False, True) - assert ('focus', '>> ') in console.format_flow(f, True, True) + assert foc not in console.format_flow(f, False, True) + assert foc in console.format_flow(f, True, True) f.response = utils.tresp() f.request = f.response.request diff --git a/test/test_dump.py b/test/test_dump.py new file mode 100644 index 00000000..da9de2b4 --- /dev/null +++ b/test/test_dump.py @@ -0,0 +1,30 @@ +from cStringIO import StringIO +import libpry +from libmproxy import dump +import utils + + + +class uDumpMaster(libpry.AutoTree): + def _dummy_cycle(self, m): + req = utils.treq() + cc = req.client_conn + resp = utils.tresp(req) + m.handle_clientconnection(cc) + m.handle_request(req) + m.handle_response(resp) + + def test_basic_verbosities(self): + for i in (1, 2, 3): + cs = StringIO() + m = dump.DumpMaster(None, i, cs) + self._dummy_cycle(m) + assert "GET" in cs.getvalue() + + + +tests = [ + uDumpMaster() +] + + |