Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1954

Show
Ignore:
Timestamp:
04/26/08 19:45:56
Author:
fumanchu
Message:

Fix for #784 (Easy resizing of test data for tut09). Thanks to Stonekeeper for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_tutorials.py

    r1868 r1954  
    145145         
    146146        # Test upload 
     147        filesize = 5 
    147148        h = [("Content-type", "multipart/form-data; boundary=x"), 
    148              ("Content-Length", "110")] 
     149             ("Content-Length", str(105 + filesize))] 
    149150        b = """--x 
    150151Content-Disposition: form-data; name="myFile"; filename="hello.txt" 
    151152Content-Type: text/plain 
    152153 
    153 hello 
     154%s 
    154155--x-- 
    155 """ 
     156""" % ("a" * filesize) 
    156157        self.getPage('/upload', h, "POST", b) 
    157158        self.assertBody('''<html> 
    158159        <body> 
    159             myFile length: 5<br /> 
     160            myFile length: %d<br /> 
    160161            myFile filename: hello.txt<br /> 
    161162            myFile mime-type: text/plain 
    162163        </body> 
    163         </html>'''
     164        </html>''' % filesize
    164165     
    165166        # Test download 

Hosted by WebFaction

Log in as guest/cpguest to create tickets