Exemplo n.º 1
0
 def test_defaultReactor(self):
     """
     If not value is passed to L{server.Session.__init__}, the global
     reactor is used.
     """
     session = server.Session(server.Site(resource.Resource()), b'123')
     self.assertIdentical(session._reactor, reactor)
Exemplo n.º 2
0
 def __init__(self, postpath, session=None):
     self.sitepath = []
     self.written = []
     self.finished = 0
     self.postpath = postpath
     self.prepath = []
     self.session = None
     self.protoSession = session or server.Session(0, self)
     self.args = {}
Exemplo n.º 3
0
 def setUp(self):
     """
     Create a site with one active session using a deterministic, easily
     controlled clock.
     """
     self.clock = Clock()
     self.uid = b'unique'
     self.site = server.Site(resource.Resource())
     self.session = server.Session(self.site, self.uid, self.clock)
     self.site.sessions[self.uid] = self.session
Exemplo n.º 4
0
 def __init__(self, postpath, session=None):
     self.sitepath = []
     self.written = []
     self.finished = 0
     self.postpath = postpath
     self.prepath = []
     self.session = None
     self.protoSession = session or server.Session(0, self)
     self.args = {}
     self.outgoingHeaders = {}
     self.responseHeaders = http_headers.Headers()
     self.responseCode = None
     self.headers = {}
     self._finishedDeferreds = []