예제 #1
0
 def test_response(self):
     e = GeneralException()
     self.assertEqual(e.response(), {"status": e.info()})
예제 #2
0
 def ping(self):
     raise GeneralException("Kaboom!!!")
예제 #3
0
 def test_info(self):
     e = GeneralException()
     self.assertEqual(e.info(), {"code": 100, "message": str(e)})
예제 #4
0
 def test_response(self):
     e = GeneralException()
     self.assertEqual(e.response(), {"status": e.info()})
예제 #5
0
 def test_info(self):
     e = GeneralException()
     self.assertEqual(e.info(), {"code": 100, "message": str(e)})
예제 #6
0
 def test_str_with_args(self):
     e = GeneralException("foo", "bar")
     self.assertEqual(str(e), "General Exception: ('foo', 'bar')")
예제 #7
0
 def test_str(self):
     e = GeneralException()
     self.assertEqual(str(e), "General Exception: ()")