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

Changeset 1103

Show
Ignore:
Timestamp:
05/10/06 02:37:40
Author:
fumanchu
Message:

New tests for params with virtual_host.

Files:

Legend:

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

    r1096 r1103  
    1414            return "Under construction" 
    1515        dom4.exposed = True 
    16  
     16         
     17        def method(self, value): 
     18            return "You sent %s" % repr(value) 
     19        method.exposed = True 
     20     
    1721    class VHost: 
    1822        def __init__(self, sitename): 
     
    2226            return "Welcome to %s" % self.sitename 
    2327        index.exposed = True 
    24  
    25  
     28         
     29        def vmethod(self, value): 
     30            return "You sent %s" % repr(value) 
     31        vmethod.exposed = True 
     32     
     33     
    2634    root = Root() 
    2735    root.mydom2 = VHost("Domain 2") 
     
    5462        self.getPage("/", [('Host', 'www.mydom4.com')]) 
    5563        self.assertBody('Under construction') 
     64         
     65        # Test GET, POST, and positional params 
     66        self.getPage("/method?value=root") 
     67        self.assertBody("You sent 'root'") 
     68        self.getPage("/vmethod?value=dom2+GET", [('Host', 'www.mydom2.com')]) 
     69        self.assertBody("You sent 'dom2 GET'") 
     70        self.getPage("/vmethod", [('Host', 'www.mydom3.com')], method="POST", 
     71                     body="value=dom3+POST") 
     72        self.assertBody("You sent 'dom3 POST'") 
     73        self.getPage("/vmethod/pos", [('Host', 'www.mydom3.com')]) 
     74        self.assertBody("You sent 'pos'") 
    5675 
    5776 

Hosted by WebFaction

Log in as guest/cpguest to create tickets