コード例 #1
0
 def test_get_str_on_exception(self):
     self.assertEqual(
         AVConfigParserErrors.get_str_on_exception(None, None),
         "Exception (KeyError), Invalid error code Exception: None")
     self.assertEqual(AVConfigParserErrors.get_str_on_exception(0, None),
                      "Success. Exception: None")
     self.assertEqual(
         AVConfigParserErrors.get_str_on_exception(0, KeyError),
         "Success. Exception: <type 'exceptions.KeyError'>")
     self.assertEqual(
         AVConfigParserErrors.get_str_on_exception(0, ValueError),
         "Success. Exception: <type 'exceptions.ValueError'>")
コード例 #2
0
 def test_get_str_on_exception(self):
     self.assertEqual(AVConfigParserErrors.get_str_on_exception(None,None),"Exception (KeyError), Invalid error code Exception: None")
     self.assertEqual(AVConfigParserErrors.get_str_on_exception(0,None),"Success. Exception: None")
     self.assertEqual(AVConfigParserErrors.get_str_on_exception(0,KeyError),"Success. Exception: <type 'exceptions.KeyError'>")
     self.assertEqual(AVConfigParserErrors.get_str_on_exception(0,ValueError),"Success. Exception: <type 'exceptions.ValueError'>")