summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-31 16:52:41 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-31 16:52:41 +0000
commit1db5469c9c189a1f5480e7f61e308a0179a2bd42 (patch)
tree4d35736b63519cf62ad36be4ef393098a4a85c8e /repoze/bfg/tests
parentab8e062ee0c610063580373001b07756e6bd0fd4 (diff)
downloadpyramid-1db5469c9c189a1f5480e7f61e308a0179a2bd42.tar.gz
pyramid-1db5469c9c189a1f5480e7f61e308a0179a2bd42.tar.bz2
pyramid-1db5469c9c189a1f5480e7f61e308a0179a2bd42.zip
- 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.
Diffstat (limited to 'repoze/bfg/tests')
-rw-r--r--repoze/bfg/tests/test_wsgi.py77
1 files changed, 0 insertions, 77 deletions
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':'<hi!>'}
- 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('&lt;hi!&gt;' 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':'<hi!>'}
- 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('&lt;hi!&gt;' 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
-
-
-
-
-
-
-