aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-03-25 10:10:48 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-03-25 10:10:48 +1300
commit74c51df5806e98046a1abea72c377781434810d8 (patch)
tree4a7ea7d7b642f1794272c5d4c9b9474b34db3fc8 /test
parent62e51018d0b7041d49e42b8e7d9b602ece356456 (diff)
downloadmitmproxy-74c51df5806e98046a1abea72c377781434810d8.tar.gz
mitmproxy-74c51df5806e98046a1abea72c377781434810d8.tar.bz2
mitmproxy-74c51df5806e98046a1abea72c377781434810d8.zip
Re-enable simple multipart form parsing and preview.
Diffstat (limited to 'test')
-rw-r--r--test/test_console_contentview.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py
index 070094ff..cbb19678 100644
--- a/test/test_console_contentview.py
+++ b/test/test_console_contentview.py
@@ -78,6 +78,32 @@ class uContentView(libpry.AutoTree):
def test_view_raw(self):
assert cv.view_hex([], "foo")
+ def test_view_multipart(self):
+ v = """
+--AaB03x
+Content-Disposition: form-data; name="submit-name"
+
+Larry
+--AaB03x
+ """.strip()
+ h = flow.ODictCaseless(
+ [("Content-Type", "multipart/form-data; boundary=AaB03x")]
+ )
+ assert cv.view_multipart(h, v)
+
+ h = flow.ODictCaseless()
+ assert not cv.view_multipart(h, v)
+
+ h = flow.ODictCaseless(
+ [("Content-Type", "multipart/form-data")]
+ )
+ assert not cv.view_multipart(h, v)
+
+ h = flow.ODictCaseless(
+ [("Content-Type", "unparseable")]
+ )
+ assert not cv.view_multipart(h, v)
+
def test_get_content_view(self):
r = cv.get_content_view(
cv.VIEW_CONTENT_RAW,