Added test for range not found

This commit is contained in:
Daniele Varrazzo 2012-09-24 00:20:48 +01:00
parent a701e36d16
commit a1a2772a79

View File

@ -1236,6 +1236,12 @@ class RangeCasterTestCase(unittest.TestCase):
self.assertEqual(ranges[i].lower_inf, r.lower_inf)
self.assertEqual(ranges[i].upper_inf, r.upper_inf)
def test_range_not_found(self):
from psycopg2.extras import register_range
cur = self.conn.cursor()
self.assertRaises(psycopg2.ProgrammingError,
register_range, 'nosuchrange', 'FailRange', cur)
decorate_all_tests(RangeCasterTestCase, skip_if_no_range)