summaryrefslogtreecommitdiffhomepage
path: root/test/test_tls.py
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2020-02-05 13:29:41 +0000
committerTiago Natel de Moura <t.nateldemoura@f5.com>2020-02-05 13:29:41 +0000
commit12e15ba43b97fe54485c6251e7d17bcb563cf0fd (patch)
tree1f967d10023a29731861d4362f08aaaca8cd6ff9 /test/test_tls.py
parentd3e218a8c379baf1af4759097d3c9c2fedb01432 (diff)
downloadunit-12e15ba43b97fe54485c6251e7d17bcb563cf0fd.tar.gz
unit-12e15ba43b97fe54485c6251e7d17bcb563cf0fd.tar.bz2
Tests: added test for uploading files with SSL.
* * * [mq]: multipart
Diffstat (limited to 'test/test_tls.py')
-rw-r--r--test/test_tls.py22
1 files changed, 22 insertions, 0 deletions
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()