From 74c51df5806e98046a1abea72c377781434810d8 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 25 Mar 2012 10:10:48 +1300 Subject: Re-enable simple multipart form parsing and preview. --- test/test_console_contentview.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/test_console_contentview.py') 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, -- cgit v1.2.3