diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-14 11:58:10 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-14 11:58:10 +1200 |
commit | bea0bd236a60e3e6c80027448e51b7802394304a (patch) | |
tree | 1cc160e19eb1834703798503f1818e4278bce1b2 /test/test_console_contentview.py | |
parent | f37efecd0a22313eacad33251512ef371557fde7 (diff) | |
download | mitmproxy-bea0bd236a60e3e6c80027448e51b7802394304a.tar.gz mitmproxy-bea0bd236a60e3e6c80027448e51b7802394304a.tar.bz2 mitmproxy-bea0bd236a60e3e6c80027448e51b7802394304a.zip |
Housekeeping and cleanups
- No output to stdout on load in examples - they muck up the test suite.
- Use the odict module directly, rather than aliasing it. The small convenience
this gives to scripters is not worth it.
- Move the cookie tests from the flow test module to the protocol_http test
module.
Diffstat (limited to 'test/test_console_contentview.py')
-rw-r--r-- | test/test_console_contentview.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py index 44378cf7..83dbbb8f 100644 --- a/test/test_console_contentview.py +++ b/test/test_console_contentview.py @@ -2,8 +2,9 @@ import os from nose.plugins.skip import SkipTest if os.name == "nt": raise SkipTest("Skipped on Windows.") - import sys + +from netlib import odict import libmproxy.console.contentview as cv from libmproxy import utils, flow, encoding import tutils @@ -30,14 +31,14 @@ class TestContentView: def test_view_auto(self): v = cv.ViewAuto() f = v( - flow.ODictCaseless(), + odict.ODictCaseless(), "foo", 1000 ) assert f[0] == "Raw" f = v( - flow.ODictCaseless( + odict.ODictCaseless( [["content-type", "text/html"]], ), "<html></html>", @@ -46,7 +47,7 @@ class TestContentView: assert f[0] == "HTML" f = v( - flow.ODictCaseless( + odict.ODictCaseless( [["content-type", "text/flibble"]], ), "foo", @@ -55,7 +56,7 @@ class TestContentView: assert f[0] == "Raw" f = v( - flow.ODictCaseless( + odict.ODictCaseless( [["content-type", "text/flibble"]], ), "<xml></xml>", @@ -166,20 +167,20 @@ Content-Disposition: form-data; name="submit-name" Larry --AaB03x """.strip() - h = flow.ODictCaseless( + h = odict.ODictCaseless( [("Content-Type", "multipart/form-data; boundary=AaB03x")] ) assert view(h, v, 1000) - h = flow.ODictCaseless() + h = odict.ODictCaseless() assert not view(h, v, 1000) - h = flow.ODictCaseless( + h = odict.ODictCaseless( [("Content-Type", "multipart/form-data")] ) assert not view(h, v, 1000) - h = flow.ODictCaseless( + h = odict.ODictCaseless( [("Content-Type", "unparseable")] ) assert not view(h, v, 1000) @@ -281,4 +282,3 @@ if cv.ViewProtobuf.is_available(): def test_get_by_shortcut(): assert cv.get_by_shortcut("h") - |