(name)
return assertok_decorator
Decorate with *assertok*.
Decorate with *assertok*.
Decorate with * assertok * .
def assertok(name):
    """Decorate with *assertok*."""
    def assertok_decorator(func):
        def func_wrapper(cls, *args, **kwargs):
            res = func(cls, *args, **kwargs)
            if cls.assertok:
                if name == 'login':
                    cls.assertok(res, name, args[0], 'xxxxxxxx')
                elif name == 'uid':
                    cls.assertok(res, name + " " + args[0], args[1:])
                else:
                    cls.assertok(res, name, *args, **kwargs)
            return res
        return func_wrapper
    return assertok_decorator
def assertok ( name ) : def assertok_decorator ( func ) : def func_wrapper ( cls , * args , * * kwargs ) : res = func ( cls , * args , * * kwargs ) if cls . assertok : if name == 'login' : cls . assertok ( res , name , args [ 0 ] , 'xxxxxxxx' ) elif name == 'uid' : cls . assertok ( res , name + " " + args [ 0 ] , args [ 1 : ] ) else : cls . assertok ( res , name , * args , * * kwargs ) return res return func_wrapper return assertok_decorator