From 12e15ba43b97fe54485c6251e7d17bcb563cf0fd Mon Sep 17 00:00:00 2001 From: Tiago Natel de Moura Date: Wed, 5 Feb 2020 13:29:41 +0000 Subject: Tests: added test for uploading files with SSL. * * * [mq]: multipart --- test/test_tls.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/test_tls.py') diff --git a/test/test_tls.py b/test/test_tls.py index 3514bbcb..1ead111c 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -1,3 +1,5 @@ +import io +import os import re import ssl import subprocess @@ -591,5 +593,25 @@ basicConstraints = critical,CA:TRUE""" 'url scheme https', ) + def test_tls_big_upload(self): + self.load('upload') + + self.certificate() + + self.add_tls(application='upload') + + filename = 'test.txt' + data = '0123456789' * 9000 + + res = self.post_ssl(body={ + 'file': { + 'filename': filename, + 'type': 'text/plain', + 'data': io.StringIO(data), + } + }) + self.assertEqual(res['status'], 200, 'status ok') + self.assertEqual(res['body'], filename + data) + if __name__ == '__main__': TestTLS.main() -- cgit