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

Changeset 716

Show
Ignore:
Timestamp:
10/05/05 13:17:44
Author:
speno
Message:

Test case for Bug326.

Files:

Legend:

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

    r522 r716  
    3434    index.exposed = True 
    3535 
     36    def bug326(self, file): 
     37        return "OK" 
     38    bug326.exposed = True 
     39 
    3640cherrypy.root = Root() 
     41 
    3742cherrypy.config.update({ 
    3843        'session.storageType': 'ram', 
     
    4853 
    4954 
     55 
    5056import helper 
    5157 
     
    5965        #self.assertInBody('Session data size') 
    6066 
     67    def testBug326(self): 
     68        httpcls = cherrypy.server.httpserverclass 
     69        if httpcls and httpcls.__name__ == "WSGIServer": 
     70            h = [("Content-type", "multipart/form-data; boundary=x"), 
     71                 ("Content-Length", "110")] 
     72            b = """--x 
     73Content-Disposition: form-data; name="file"; filename="hello.txt" 
     74Content-Type: text/plain 
     75 
     76hello 
     77--x-- 
     78""" 
     79            cherrypy.config.update({ 
     80                '/bug326': {'server.maxRequestBodySize': 3, 
     81                            'server.environment': 'developement', 
     82                } 
     83            }) 
     84            ignore = helper.webtest.ignored_exceptions 
     85            ignore.append(AttributeError) 
     86            try: 
     87                self.getPage('/bug326', h, "POST", b) 
     88                self.assertStatus("413 Request Entity Too Large") 
     89            finally: 
     90                ignore.pop() 
    6191 
    6292if __name__ == "__main__": 

Hosted by WebFaction

Log in as guest/cpguest to create tickets