summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-04-27 00:45:56 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-04-27 00:45:56 +0000
commit9c0f2371d4b65537c31e19458d6df7621f7525df (patch)
tree5e56ea1717135bee16f6f121b7daf41b99db4072
parent795320485cc09aa0a19b7782405bbc00ae450a6a (diff)
downloadcherrypy-9c0f2371d4b65537c31e19458d6df7621f7525df.tar.gz
Fix for #784 (Easy resizing of test data for tut09). Thanks to Stonekeeper for the patch.
-rw-r--r--cherrypy/test/test_tutorials.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cherrypy/test/test_tutorials.py b/cherrypy/test/test_tutorials.py
index 5aac2180..4cfe6f05 100644
--- a/cherrypy/test/test_tutorials.py
+++ b/cherrypy/test/test_tutorials.py
@@ -144,23 +144,24 @@ class TutorialTest(helper.CPWebCase):
self.getPage("/load_tut_module/tut09_files")
# Test upload
+ filesize = 5
h = [("Content-type", "multipart/form-data; boundary=x"),
- ("Content-Length", "110")]
+ ("Content-Length", str(105 + filesize))]
b = """--x
Content-Disposition: form-data; name="myFile"; filename="hello.txt"
Content-Type: text/plain
-hello
+%s
--x--
-"""
+""" % ("a" * filesize)
self.getPage('/upload', h, "POST", b)
self.assertBody('''<html>
<body>
- myFile length: 5<br />
+ myFile length: %d<br />
myFile filename: hello.txt<br />
myFile mime-type: text/plain
</body>
- </html>''')
+ </html>''' % filesize)
# Test download
self.getPage('/download')