From bea0bd236a60e3e6c80027448e51b7802394304a Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 14 Apr 2015 11:58:10 +1200 Subject: 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. --- test/test_console_contentview.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/test_console_contentview.py') 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"]], ), "", @@ -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"]], ), "", @@ -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") - -- cgit v1.2.3