diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-03 09:52:26 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-03 09:52:26 +1200 |
commit | f526e5fa125339e8f3a16c1590c1607f45862b47 (patch) | |
tree | 041f77932eb145775d69369869d0a8e012415b1c | |
parent | 4979a22d3e1e62786394b0038842ff9e20554619 (diff) | |
download | mitmproxy-f526e5fa125339e8f3a16c1590c1607f45862b47.tar.gz mitmproxy-f526e5fa125339e8f3a16c1590c1607f45862b47.tar.bz2 mitmproxy-f526e5fa125339e8f3a16c1590c1607f45862b47.zip |
Minor unit test bump.
-rw-r--r-- | libmproxy/console/__init__.py | 2 | ||||
-rw-r--r-- | test/test_console.py | 3 | ||||
-rw-r--r-- | test/test_dump.py | 9 |
3 files changed, 11 insertions, 3 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index c0700b56..a0a743b5 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -25,7 +25,6 @@ EVENTLOG_SIZE = 500 class Stop(Exception): pass -#begin nocover class _PathCompleter: @@ -75,6 +74,7 @@ class _PathCompleter: self.final = ret[1] return ret[0] +#begin nocover class PathEdit(urwid.Edit, _PathCompleter): def __init__(self, *args, **kwargs): diff --git a/test/test_console.py b/test/test_console.py index 4ed65a16..a570f3e5 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -113,7 +113,8 @@ class uPathCompleter(libpry.AutoTree): c.reset() assert c.complete("./completion/aaa") == "./completion/aaa" assert c.complete("./completion/aaa") == "./completion/aaa" - + c.reset() + assert c.complete("./completion") == "./completion/aaa" def test_completion(self): c = console._PathCompleter(True) diff --git a/test/test_dump.py b/test/test_dump.py index e7874841..b2b5d8cd 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -27,8 +27,9 @@ class uDumpMaster(libpry.AutoTree): resp.content = content m.handle_clientconnect(cc) m.handle_request(req) - m.handle_response(resp) + f = m.handle_response(resp) m.handle_clientdisconnect(flow.ClientDisconnect(cc)) + return f def _dummy_cycle(self, n, filt, content, **options): cs = StringIO() @@ -93,6 +94,12 @@ class uDumpMaster(libpry.AutoTree): def test_filter(self): assert not "GET" in self._dummy_cycle(1, "~u foo", "", verbosity=1) + def test_replacements(self): + o = dump.Options(replacements=[(".*", "content", "foo")]) + m = dump.DumpMaster(None, o, None) + f = self._cycle(m, "content") + assert f.request.content == "foo" + def test_basic(self): for i in (1, 2, 3): assert "GET" in self._dummy_cycle(1, "~s", "", verbosity=i, eventlog=True) |