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

Changeset 411

Show
Ignore:
Timestamp:
07/05/05 18:37:57
Author:
fumanchu
Message:

Added test for multiple params of same name, and test for NotFound? exception.

Files:

Legend:

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

    r385 r411  
    4949class Test(object): 
    5050    __metaclass__ = TestType 
     51 
     52 
     53class Params(Test): 
     54     
     55    def index(self, thing): 
     56        return thing 
    5157 
    5258 
     
    213219     
    214220    def testConfig(self): 
    215         import cherrypy 
    216221        tests = [ 
    217222            ('/',        'nex', None   ), 
     
    230235            self.assertEqual(result, expected) 
    231236     
     237    def testParams(self): 
     238        helper.request("/params/?thing=a") 
     239        self.assertEqual(cherrypy.response.body, 'a') 
     240         
     241        helper.request("/params/?thing=a&thing=b&thing=c") 
     242        self.assertEqual(cherrypy.response.body, 'abc') 
     243     
    232244    def testStatus(self): 
    233245        helper.request("/status/") 
     
    314326     
    315327    def testErrorHandling(self): 
     328        helper.request("/error/missing") 
     329        self.assert_("NotFound" in cherrypy.response.body) 
     330         
    316331        valerr = '\n    raise ValueError\nValueError\n' 
    317332        helper.request("/error/page_method") 
     
    338353                                  'Location', 'Server']) 
    339354     
    340     def testMethods(self): 
     355    def testHTTPMethods(self): 
    341356        # Test that all defined HTTP methods work. 
    342357        for m in defined_http_methods: 

Hosted by WebFaction

Log in as guest/cpguest to create tickets