示例#1
0
    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))
示例#2
0
    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))
示例#3
0
    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))