diff options
Diffstat (limited to 'test/test_console_contentview.py')
-rw-r--r-- | test/test_console_contentview.py | 26 |
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, |