~ubuntu-branches/ubuntu/lucid/twisted-web2/lucid

« back to all changes in this revision

Viewing changes to twisted/web2/test/test_vhost.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-23 00:38:42 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060223003842-rcpl8v09a91wfpvr
Tags: 0.1.0.20060222-1ubuntu1
Synchronize with Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
class HostResource(BaseTestResource):
10
10
    addSlash=True
11
 
    def child_bar(self, ctx):
 
11
    def child_bar(self, req):
12
12
        return self
13
13
 
14
 
    def render(self, ctx):
15
 
        h = iweb.IRequest(ctx).host
 
14
    def render(self, req):
 
15
        h = req.host
16
16
        return http.Response(responsecode.OK, stream=h)
17
17
 
18
18
class TestVhost(BaseCase):
67
67
            (200, {}, 'is.nested'))
68
68
    
69
69
class PathResource(resource.LeafResource):
70
 
    def render(self, ctx):  
71
 
        r = iweb.IRequest(ctx)
72
 
        response = r.scheme+'://'+'/'.join([r.host,] + r.prepath + r.postpath)
 
70
    def render(self, req):  
 
71
        response = req.scheme+'://'+'/'.join([req.host,] + req.prepath + req.postpath)
73
72
        return http.Response(responsecode.OK, stream=response)
74
73
 
75
74
class TestURIRewrite(BaseCase):