From 1db5469c9c189a1f5480e7f61e308a0179a2bd42 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 31 May 2009 16:52:41 +0000 Subject: - Remove ``repoze.bfg.wsgi.HTTPException``, ``repoze.bfg.wsgi.NotFound``, and ``repoze.bfg.wsgi.Unauthorized``. These classes were disused with the introduction of the ``IUnauthorizedView`` and ``INotFoundView`` machinery. --- repoze/bfg/tests/test_wsgi.py | 77 ------------------------------------------- 1 file changed, 77 deletions(-) (limited to 'repoze/bfg/tests') diff --git a/repoze/bfg/tests/test_wsgi.py b/repoze/bfg/tests/test_wsgi.py index 893364635..9d8a85630 100644 --- a/repoze/bfg/tests/test_wsgi.py +++ b/repoze/bfg/tests/test_wsgi.py @@ -109,76 +109,6 @@ class WSGIApp2Tests(unittest.TestCase): self.assertEqual(request.environ['PATH_INFO'], '/') self.assertEqual(request.environ['SCRIPT_NAME'], '') -class TestNotFound(unittest.TestCase): - def _getTargetClass(self): - from repoze.bfg.wsgi import NotFound - return NotFound - - def _makeOne(self): - return self._getTargetClass()() - - def test_no_message(self): - environ = {} - L = [] - def start_response(status, headers): - L.append((status, headers)) - app = self._makeOne() - result = app(environ, start_response) - self.assertEqual(len(result), 1) - self.failUnless('404 Not Found' in result[0]) - self.assertEqual(L[0][0], '404 Not Found') - self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))), - ('Content-Type', 'text/html')]) - - def test_with_message(self): - environ = {'repoze.bfg.message':''} - L = [] - def start_response(status, headers): - L.append((status, headers)) - app = self._makeOne() - result = app(environ, start_response) - self.assertEqual(len(result), 1) - self.failUnless('404 Not Found' in result[0]) - self.failUnless('<hi!>' in result[0]) - self.assertEqual(L[0][0], '404 Not Found') - self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))), - ('Content-Type', 'text/html')]) - -class TestUnauthorized(unittest.TestCase): - def _getTargetClass(self): - from repoze.bfg.wsgi import Unauthorized - return Unauthorized - - def _makeOne(self): - return self._getTargetClass()() - - def test_no_message(self): - environ = {} - L = [] - def start_response(status, headers): - L.append((status, headers)) - app = self._makeOne() - result = app(environ, start_response) - self.assertEqual(len(result), 1) - self.failUnless('401 Unauthorized' in result[0]) - self.assertEqual(L[0][0], '401 Unauthorized') - self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))), - ('Content-Type', 'text/html')]) - - def test_with_message(self): - environ = {'repoze.bfg.message':''} - L = [] - def start_response(status, headers): - L.append((status, headers)) - app = self._makeOne() - result = app(environ, start_response) - self.assertEqual(len(result), 1) - self.failUnless('401 Unauthorized' in result[0]) - self.failUnless('<hi!>' in result[0]) - self.assertEqual(L[0][0], '401 Unauthorized') - self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))), - ('Content-Type', 'text/html')]) - def dummyapp(environ, start_response): """ """ @@ -188,10 +118,3 @@ class DummyContext: class DummyRequest: def get_response(self, application): return application - - - - - - - -- cgit v1.2.3