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)
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)