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

Changeset 1768

Show
Ignore:
Timestamp:
10/26/07 20:44:31
Author:
fumanchu
Message:

Docs and new url() test.

Files:

Legend:

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

    r1767 r1768  
    493493        newurl = '/'.join(atoms) 
    494494     
     495    # At this point, we should have a fully-qualified absolute URL. 
     496     
    495497    if relative: 
    496498        old = url().split('/')[:-1] 
  • trunk/cherrypy/_cprequest.py

    r1767 r1768  
    326326    The default 'None' implies that no authentication happened.""" 
    327327     
     328    # Note that cherrypy.url uses "if request.app:" to determine whether 
     329    # the call is during a real HTTP request or not. So leave this None. 
    328330    app = None 
    329331    app__doc = \ 
  • trunk/cherrypy/test/test_core.py

    r1728 r1768  
    5050            return "Size: %s" % len(file.file.read()) 
    5151        upload.exposed = True 
     52         
     53        def baseurl(self, path_info, relative=None): 
     54            return cherrypy.url(path_info, relative=bool(relative)) 
     55        baseurl.exposed = True 
    5256     
    5357    root = Root() 
     
    10661070        self.getPage('/url/?path_info=other/../page1&relative=True') 
    10671071        self.assertBody('page1') 
     1072         
     1073        # Output relative to / 
     1074        self.getPage('/baseurl?path_info=ab&relative=True') 
     1075        self.assertBody('ab') 
     1076        # Output relative to / 
     1077        self.getPage('/baseurl?path_info=/ab&relative=True') 
     1078        self.assertBody('ab') 
    10681079 
    10691080 

Hosted by WebFaction

Log in as guest/cpguest to create tickets