Add test to parse_multipart_form_data() when no "name" parameter is found

This commit is contained in:
Igor Sobreira 2012-01-25 00:19:40 -02:00
parent 97009a380e
commit b12edb12d5
1 changed files with 12 additions and 0 deletions

View File

@ -162,6 +162,18 @@ Foo--1234--''').replace(b("\n"), b("\r\n"))
parse_multipart_form_data(b("1234"), data, args, files)
self.assertEqual(files, {})
def test_content_disposition_header_without_name_parameter(self):
data = b("""\
--1234
Content-Disposition: form-data; filename="ab.txt"
Foo
--1234--""").replace(b("\n"), b("\r\n"))
args = {}
files = {}
parse_multipart_form_data(b("1234"), data, args, files)
self.assertEqual(files, {})
class HTTPHeadersTest(unittest.TestCase):
def test_multi_line(self):