summaryrefslogtreecommitdiff
path: root/tests/post_test.py
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2015-10-23 08:31:56 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2015-10-23 20:04:35 -0400
commit28ada09c74e8a5bfd067d4695ab25dd636a4dd97 (patch)
tree49d9c9ffbf261b44a27e0c6d7352bf19b8c1b3ec /tests/post_test.py
parent81747f0425124ea68f9a4fbbcc13476ad0e2cb5e (diff)
downloadpycurl-28ada09c74e8a5bfd067d4695ab25dd636a4dd97.tar.gz
Add a test for all lists
Diffstat (limited to 'tests/post_test.py')
-rw-r--r--tests/post_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/post_test.py b/tests/post_test.py
index dd346db..5491f60 100644
--- a/tests/post_test.py
+++ b/tests/post_test.py
@@ -171,6 +171,18 @@ class PostTest(unittest.TestCase):
}]
self.check_post(send, expect, 'http://localhost:8380/files')
+ def test_post_list_of_list_of_lists(self):
+ contents = util.u('hello, world!')
+ send = [
+ ['field2', [pycurl.FORM_BUFFER, 'uploaded.file', pycurl.FORM_BUFFERPTR, contents]],
+ ]
+ expect = [{
+ 'name': 'field2',
+ 'filename': 'uploaded.file',
+ 'data': 'hello, world!',
+ }]
+ self.check_post(send, expect, 'http://localhost:8380/files')
+
# XXX this test takes about a second to run, check keep-alives?
def check_post(self, send, expect, endpoint):
self.curl.setopt(pycurl.URL, endpoint)