def test_get_error_code_empty_code_field(self): error_field = "::" result = get_error_code(error_field) self.assertIsNone(result)
def test_get_error_code_short_invalid_field(self): error_field = "12::" result = get_error_code(error_field) self.assertIsNone(result)
def test_get_error_code(self): error_field = "123::" result = get_error_code(error_field) self.assertEqual(result, 123)
def test_get_error_code_none_field(self): error_field = None result = get_error_code(error_field) self.assertIsNone(result)
def error_code(self) -> Optional[int]: """Error code part of the error code part of the `error\ <https://docs.cometd.org/current/reference/#_code_error_code>`_, \ message field""" return utils.get_error_code(self.error)