From 64372401084889a440c9d990a0febc221e3e4b5c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 25 Oct 2010 10:29:31 -0400 Subject: first pass at converting bfg to pyramid namespace --- repoze/bfg/tests/test_exceptions.py | 45 ------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 repoze/bfg/tests/test_exceptions.py (limited to 'repoze/bfg/tests/test_exceptions.py') diff --git a/repoze/bfg/tests/test_exceptions.py b/repoze/bfg/tests/test_exceptions.py deleted file mode 100644 index 4091eb941..000000000 --- a/repoze/bfg/tests/test_exceptions.py +++ /dev/null @@ -1,45 +0,0 @@ -import unittest - -class TestExceptionResponse(unittest.TestCase): - def _makeOne(self, message): - from repoze.bfg.exceptions import ExceptionResponse - return ExceptionResponse(message) - - def test_app_iter(self): - exc = self._makeOne('') - self.failUnless('' in exc.app_iter[0]) - - def test_headerlist(self): - exc = self._makeOne('') - headerlist = exc.headerlist - headerlist.sort() - app_iter = exc.app_iter - clen = str(len(app_iter[0])) - self.assertEqual(headerlist[0], ('Content-Length', clen)) - self.assertEqual(headerlist[1], ('Content-Type', 'text/html')) - - def test_withmessage(self): - exc = self._makeOne('abc&123') - self.failUnless('abc&123' in exc.app_iter[0]) - -class TestNotFound(unittest.TestCase): - def _makeOne(self, message): - from repoze.bfg.exceptions import NotFound - return NotFound(message) - - def test_it(self): - from repoze.bfg.exceptions import ExceptionResponse - e = self._makeOne('notfound') - self.failUnless(isinstance(e, ExceptionResponse)) - self.assertEqual(e.status, '404 Not Found') - -class TestForbidden(unittest.TestCase): - def _makeOne(self, message): - from repoze.bfg.exceptions import Forbidden - return Forbidden(message) - - def test_it(self): - from repoze.bfg.exceptions import ExceptionResponse - e = self._makeOne('unauthorized') - self.failUnless(isinstance(e, ExceptionResponse)) - self.assertEqual(e.status, '401 Unauthorized') -- cgit v1.2.3