コード例 #1
0
ファイル: test_util.py プロジェクト: zerospam/twisted
    def doLocationTest(self, requestPath: bytes):
        """
        Render a response to a request with path *requestPath*

        @param requestPath: A slash-separated path like C{b'/foo/bar'}.

        @returns: The value of the I{Location} header.
        """
        request = Request(DummyChannel(), True)
        request.method = b"GET"
        request.prepath = requestPath.lstrip(b"/").split(b"/")

        resource = ParentRedirect()
        resource.render(request)

        [location] = request.responseHeaders.getRawHeaders(b"Location")
        return location
コード例 #2
0
 def render(self, request):
     self.action()
     return ParentRedirect.render(self, request)
コード例 #3
0
	def render(self, request):
		self.action()
		return ParentRedirect.render(self, request)