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