Ejemplo n.º 1
0
def _get_rh_methods(rh):
    """Yield all HTTP methods in ``rh`` that are decorated
    with schema.validate"""
    for k, v in vars(rh).items():
        if all([
            k in HTTP_METHODS,
            is_method(v),
            hasattr(v, "input_schema")
        ]):
            yield (k, v)
Ejemplo n.º 2
0
 def has_method(module, cls_name, method_name):
     return all([
         method_name in vars(getattr(module, cls_name)),
         is_method(reduce(getattr, [module, cls_name, method_name]))
     ])
Ejemplo n.º 3
0
 def has_method(module, cls_name, method_name):
     return all([
         method_name in vars(getattr(module, cls_name)),
         is_method(reduce(getattr, [module, cls_name, method_name]))
     ])