Esempio n. 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
Esempio n. 2
0
 def test_raise_redis_exceptions_single_exception_and_results(self):
     with self.assertRaises(TestException):
         orm.raise_redis_exceptions([None, TestException(), 4, 5])
Esempio n. 3
0
 def test_raise_redis_exceptions_no_exceptions(self):
     self.assertEqual(orm.raise_redis_exceptions([1, 2, 3]), [1, 2, 3])
Esempio n. 4
0
 def test_raise_redis_exceptions_single_exception(self):
     with self.assertRaises(TestException):
         orm.raise_redis_exceptions([TestException()])
Esempio n. 5
0
 def test_raise_redis_exceptions_no_results(self):
     self.assertEqual(orm.raise_redis_exceptions([]), [])