diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-02-07 16:39:37 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-02-07 16:39:37 +1300 |
commit | cdd5a53767e51a6d992bf8d08df2733e7af916b8 (patch) | |
tree | be7d42be2960ef42675779d1494a1f5469199be5 /test | |
parent | f7b3a6d571059aef84e26ac82b9cc67a081230f6 (diff) | |
download | mitmproxy-cdd5a53767e51a6d992bf8d08df2733e7af916b8.tar.gz mitmproxy-cdd5a53767e51a6d992bf8d08df2733e7af916b8.tar.bz2 mitmproxy-cdd5a53767e51a6d992bf8d08df2733e7af916b8.zip |
Refactor console.
Split the console implementation out into logical components.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_console.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/test/test_console.py b/test/test_console.py index a935c146..3de9cca4 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -1,4 +1,5 @@ from libmproxy import console, filt, flow +from libmproxy.console import common import tutils import libpry @@ -78,7 +79,7 @@ class uState(libpry.AutoTree): class uformat_keyvals(libpry.AutoTree): def test_simple(self): - assert console.format_keyvals( + assert common.format_keyvals( [ ("aa", "bb"), None, @@ -93,11 +94,11 @@ class uformat_flow(libpry.AutoTree): def test_simple(self): f = tutils.tflow() foc = ('focus', '>>') - assert foc not in console.format_flow(f, False) - assert foc in console.format_flow(f, True) + assert foc not in common.format_flow(f, False) + assert foc in common.format_flow(f, True) - assert foc not in console.format_flow(f, False, True) - assert foc in console.format_flow(f, True, True) + assert foc not in common.format_flow(f, False, True) + assert foc in common.format_flow(f, True, True) f.response = tutils.tresp() f.request = f.response.request @@ -105,17 +106,17 @@ class uformat_flow(libpry.AutoTree): f.request._set_replay() f.response._set_replay() - assert ('method', '[replay]') in console.format_flow(f, True) - assert ('method', '[replay]') in console.format_flow(f, True, True) + assert ('method', '[replay]') in common.format_flow(f, True) + assert ('method', '[replay]') in common.format_flow(f, True, True) f.response.code = 404 - assert ('error', '404') in console.format_flow(f, True, True) + assert ('error', '404') in common.format_flow(f, True, True) f.response.headers["content-type"] = ["text/html"] - assert ('text', ' text/html') in console.format_flow(f, True, True) + assert ('text', ' text/html') in common.format_flow(f, True, True) f.response =None f.error = flow.Error(f.request, "error") - assert ('error', 'error') in console.format_flow(f, True, True) + assert ('error', 'error') in common.format_flow(f, True, True) @@ -169,7 +170,7 @@ class uOptions(libpry.AutoTree): tests = [ uformat_keyvals(), uformat_flow(), - uState(), + uState(), uPathCompleter(), uOptions() ] |