Пример #1
0
 def _doit(self, content_type):
     from pyramid.httpexceptions import status_map
     L = []
     self.assertTrue(status_map)
     for v in status_map.values():
         environ = _makeEnviron()
         start_response = DummyStartResponse()
         exc = v()
         exc.content_type = content_type
         result = list(exc(environ, start_response))[0]
         if exc.empty_body:
             self.assertEqual(result, b'')
         else:
             self.assertTrue(bytes_(exc.status) in result)
         L.append(result)
     self.assertEqual(len(L), len(status_map))
Пример #2
0
 def _doit(self, content_type):
     from pyramid.httpexceptions import status_map
     L = []
     self.assertTrue(status_map)
     for v in status_map.values():
         environ = _makeEnviron()
         start_response = DummyStartResponse()
         exc = v()
         exc.content_type = content_type
         result = list(exc(environ, start_response))[0]
         if exc.empty_body:
             self.assertEqual(result, b'')
         else:
             self.assertTrue(bytes_(exc.status) in result)
         L.append(result)
     self.assertEqual(len(L), len(status_map))