def test_get_args_and_defaults(self): def target(a, b, c=None, d=None): pass args_specs, defaults = evelink_api.get_args_and_defaults(target) self.assertEqual(['a', 'b', 'c', 'd'], args_specs) self.assertEqual({'c': None, 'd': None}, defaults)
def wrapper(*args, **kwargs): defaultargs, defaultkwargs = api.get_args_and_defaults(func) mapped_args = api.map_func_args(args, kwargs, defaultargs, defaultkwargs) if mapped_args.get('api') is None: kwargs['api'] = AppEngineAPI() return func(*args, **kwargs)