diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index 34f3ae4aa..5f80c250d 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -41,7 +41,7 @@ def format_keyvals(lst, key="key", val="text", indent=0): maxk = min(max(len(i[0]) for i in lst if i and i[0]), KEY_MAX) for i, kv in enumerate(lst): if kv is None: - ret.append(Text("")) + ret.append(urwid.Text("")) else: ret.append( urwid.Columns( diff --git a/test/test_console.py b/test/test_console.py index 6db2f994a..cad613220 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -90,36 +90,6 @@ class uformat_keyvals(libpry.AutoTree): ) -class uformat_flow(libpry.AutoTree): - def test_simple(self): - f = tutils.tflow() - foc = ('focus', '>>') - assert foc not in common.format_flow(f, False) - assert foc in common.format_flow(f, 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 - f.backup() - - f.request._set_replay() - f.response._set_replay() - 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 common.format_flow(f, True, True) - f.response.headers["content-type"] = ["text/html"] - 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 common.format_flow(f, True, True) - - - class uPathCompleter(libpry.AutoTree): def test_lookup_construction(self): c = console._PathCompleter() @@ -169,7 +139,6 @@ class uOptions(libpry.AutoTree): tests = [ uformat_keyvals(), - uformat_flow(), uState(), uPathCompleter(), uOptions() diff --git a/test/test_flow.py b/test/test_flow.py index 45daf0c5c..94c4614d7 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -830,7 +830,7 @@ class uError(libpry.AutoTree): def test_getset_state(self): e = flow.Error(None, "Error") state = e._get_state() - assert flow.Error._from_state(state) == e + assert flow.Error._from_state(None, state) == e assert e.copy()