Beispiel #1
0
 def handleException(self, object, request, exc_info, retry_allowed=1):
     if exc_info[0] is Conflict and retry_allowed:
         # This simulates a ZODB retry.
         raise Retry(exc_info)
     else:
         DefaultPublication.handleException(self, object, request, exc_info,
                                            retry_allowed)
Beispiel #2
0
 def handleException(self, object, request, exc_info, retry_allowed=1):
     if exc_info[0] is Conflict and retry_allowed:
         # This simulates a ZODB retry.
         raise Retry(exc_info)
     else:
         DefaultPublication.handleException(self, object, request, exc_info,
                                            retry_allowed)
Beispiel #3
0
 def _createRequest(self, path, **kw):
     publication = DefaultPublication(self.app)
     path = path.split('/')
     path.reverse()
     request = TestRequest(StringIO(''), **kw)
     request.setTraversalStack(path)
     request.setPublication(publication)
     return request
Beispiel #4
0
    def _createRequest(self, extra_env={}, body=b""):
        env = self._testEnv.copy()
        env.update(extra_env)
        if len(body):
            env['CONTENT_LENGTH'] = str(len(body))

        publication = DefaultPublication(self.app)
        instream = BytesIO(body)
        request = HTTPRequest(instream, env)
        request.setPublication(publication)
        return request
Beispiel #5
0
 def testImplementsIPublication(self):
     self.failUnless(IPublication.providedBy(
                         DefaultPublication(self.app)))
 def testImplementsIPublication(self):
     self.assertTrue(IPublication.providedBy(DefaultPublication(self.app)))