示例#1
0
 def test_raise_redis_exceptions_multiple_exception(self):
     exceptions = [TestException('a'), TestException('b')]
     with self.assertRaises(orm.MultiRedisError):
         try:
             orm.raise_redis_exceptions(exceptions)
         except orm.MultiRedisError, e:
             # mark 2 more lines as covered :p
             repr(e)
             str(e)
             self.assertEqual(e.exceptions, exceptions)
             raise
示例#2
0
 def test_raise_redis_exceptions_single_exception_and_results(self):
     with self.assertRaises(TestException):
         orm.raise_redis_exceptions([None, TestException(), 4, 5])
示例#3
0
 def test_raise_redis_exceptions_no_exceptions(self):
     self.assertEqual(orm.raise_redis_exceptions([1, 2, 3]), [1, 2, 3])
示例#4
0
 def test_raise_redis_exceptions_single_exception(self):
     with self.assertRaises(TestException):
         orm.raise_redis_exceptions([TestException()])
示例#5
0
 def test_raise_redis_exceptions_no_results(self):
     self.assertEqual(orm.raise_redis_exceptions([]), [])