def test_InformError_no_func(self): code = 1000 msg = "an inform error occurred - \"unrecognized error\"" e = err.InformError(code) self.assertEqual(code, e.error_code.value) self.assertEqual(msg, str(e))
def test_InformError_default(self): code = -1 msg = "an inform error occurred - \"generic failure\"" e = err.InformError() self.assertEqual(code, e.error_code.value) self.assertEqual(msg, str(e))
def test_InformError_func(self): code = 1000 func = "active_info" msg = "an inform error occurred in `active_info` - \"unrecognized error\"" e = err.InformError(code, func) self.assertEqual(code, e.error_code.value) self.assertEqual(msg, str(e))