def test_loggable_log_exc_obj(self): loggable = Loggable() exc = TypeError(u"Message") with self.assertRaises(TypeError): loggable.log_exc(u"Message", exc, True, TypeError) self.assertEqual(len(loggable.logger), 1)
def test_loggable_log_exc_crit_no_raise(self): loggable = Loggable() loggable.log_exc(u"Message", None, True, None) self.assertEqual(len(loggable.logger), 1)
def test_loggable_log_exc_crit_raise(self): loggable = Loggable() with self.assertRaises(TypeError): loggable.log_exc(u"Message", None, True, TypeError) self.assertEqual(len(loggable.logger), 1)
def test_loggable_log_exc_warn(self): loggable = Loggable() loggable.log_exc(u"Message", None, False, None) self.assertEqual(len(loggable.logger), 1)