예제 #1
0
 def test_without_error_without_result(self):
     message = ResultMessage(self.id)
     self.assertEqual(message.id, self.id)
     self.assertFalse(message.has_error())
     self.assertIsNone(message.error)
     self.assertFalse(message.has_result())
     self.assertIsNone(message.result)
예제 #2
0
 def test_with_result(self):
     message = ResultMessage(self.id, result=self.result)
     self.assertEqual(message.id, self.id)
     self.assertTrue(message.has_result())
     self.assertEqual(message.result, self.result)
     self.assertFalse(message.has_error())
     self.assertIsNone(message.error)