Beispiel #1
0
 def testDefaultFilterAlternateError(self):
   application = filters.static_page(content='it went awry',
                                     status=(500, 'oh no!'))
   self.StartWebServer(filters.filter_request(lambda environ: True,
                                              app=application))
   self.CheckError('/', content='it went arwy', expected_code=500,
                   expected_content='it went arwy')
Beispiel #2
0
 def testDefaultFilterFalse(self):
   self.StartWebServer(filters.filter_request(lambda environ: False))
   self.CheckError('/')
Beispiel #3
0
 def testDefaultFilterAlternateApplication(self):
   application = filters.static_page(content='it was ok')
   self.StartWebServer(filters.filter_request(lambda environ: True,
                                              app=application))
   response = self.SendRequest('/')
   self.CheckResponse(response, expected_content='it was ok')
Beispiel #4
0
 def testDefaultFilterTrue(self):
   self.StartWebServer(filters.filter_request(lambda environ: True))
   self.CheckResponse(self.SendRequest('/'))