def decorate_handler(self, handler): for key, attr in handler.__dict__.items(): if is_grpc_method(attr): setattr(handler, key, self.wrap_method_with_errorhandler(attr)) return handler
def test_is_grpc_method(self): target = 1 assert not is_grpc_method(target) target = None assert not is_grpc_method(target)