Esempio n. 1
0
	def _makeDummyRequest(self, postpath, path, site):
		request = DummyRequest(postpath)
		if path is not None:
			request.path = path
		if site is not None:
			request.channel.site = site
		return request
Esempio n. 2
0
def makeRequestForPath(site, path):
	"""
	@param site: a L{server.Site}.
	@param path: a C{str} URL-encoded path that starts with C{"/"}.

	@return: a request that requests C{path}.
	"""
	# Unquote URL with the same function that twisted.web.server uses.
	postpath = unquote(path).split('/')
	postpath.pop(0)
	dummyRequest = DummyRequest(postpath)
	dummyRequest.path = path
	dummyRequest.channel.site = site
	return dummyRequest
Esempio n. 3
0
def makeRequestForPath(site, path):
    """
	@param site: a L{server.Site}.
	@param path: a C{str} URL-encoded path that starts with C{"/"}.

	@return: a request that requests C{path}.
	"""
    # Unquote URL with the same function that twisted.web.server uses.
    postpath = unquote(path).split('/')
    postpath.pop(0)
    dummyRequest = DummyRequest(postpath)
    dummyRequest.path = path
    dummyRequest.channel.site = site
    return dummyRequest