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

Changeset 1490

Show
Ignore:
Timestamp:
12/09/06 13:44:32
Author:
fumanchu
Message:

2.x backport of [1103] (new tests for params with virtual_host).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/test/test_virtualhost_filter.py

    r1241 r1490  
    1414            return "Under construction" 
    1515        dom4.exposed = True 
     16         
     17        def method(self, value): 
     18            return "You sent %s" % repr(value) 
     19        method.exposed = True 
    1620     
    1721    class VHost: 
     
    2630            return "Over the %s rainbow" % self.sitename 
    2731        somewhere.exposed = True 
    28      
     32         
     33        def vmethod(self, value): 
     34            return "You sent %s" % repr(value) 
     35        vmethod.exposed = True 
    2936     
    3037    cherrypy.root = Root() 
     
    6370        self.getPage("/somewhere", [('Host', 'www.mydom3.com')]) 
    6471        self.assertBody('Over the Domain 3 rainbow') 
     72         
     73        # Test GET, POST, and positional params 
     74        self.getPage("/method?value=root") 
     75        self.assertBody("You sent 'root'") 
     76        self.getPage("/vmethod?value=dom2+GET", [('Host', 'www.mydom2.com')]) 
     77        self.assertBody("You sent 'dom2 GET'") 
     78        self.getPage("/vmethod", [('Host', 'www.mydom3.com')], method="POST", 
     79                     body="value=dom3+POST") 
     80        self.assertBody("You sent 'dom3 POST'") 
     81        self.getPage("/vmethod/pos", [('Host', 'www.mydom3.com')]) 
     82        self.assertBody("You sent 'pos'") 
    6583 
    6684 

Hosted by WebFaction

Log in as guest/cpguest to create tickets