diff options
| author | Richard Barrell <rchrd@brrll.co.uk> | 2011-11-08 16:39:19 -0800 |
|---|---|---|
| committer | Richard Barrell <rchrd@brrll.co.uk> | 2011-11-08 16:39:19 -0800 |
| commit | dad2150ebea0040f5b1a5721331f479121216dc5 (patch) | |
| tree | ddfd784e4b2904986d4afb807ab9f1ba9578869c | |
| parent | a3ff61a5a554973e4c84c2120f0c6c019e192d9e (diff) | |
| download | pyramid-dad2150ebea0040f5b1a5721331f479121216dc5.tar.gz pyramid-dad2150ebea0040f5b1a5721331f479121216dc5.tar.bz2 pyramid-dad2150ebea0040f5b1a5721331f479121216dc5.zip | |
Added a unit test that asserts that HTTPFound(location=None) throws a ValueError.
| -rw-r--r-- | pyramid/tests/test_httpexceptions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pyramid/tests/test_httpexceptions.py b/pyramid/tests/test_httpexceptions.py index 927d27733..d319a59a0 100644 --- a/pyramid/tests/test_httpexceptions.py +++ b/pyramid/tests/test_httpexceptions.py @@ -294,6 +294,16 @@ class Test_HTTPMove(unittest.TestCase): from pyramid.httpexceptions import _HTTPMove return _HTTPMove(*arg, **kw) + def test_it_location_none_valueerrors(self): + """ Constructing a HTTPMove instance with location=None should + throw a ValueError from __init__ so that a more-confusing + exception won't be thrown later from .prepare(environ) """ + try: + exc = self._makeOne(location=None) + self.assertEqual(1, 0) + except ValueError, e: + pass + def test_it_location_not_passed(self): exc = self._makeOne() self.assertEqual(exc.location, '') |
