def _test_static_method_with_args(self, *args, **kwargs): class Foo: @staticmethod def bar(x, y): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def _test_class_method_with_args(self, *args, **kwargs): class Foo: @classmethod def bar(cls, x, y): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def test_static_method_no_args(self): class Foo(object): @staticmethod def bar(): pass cliutils.validate_args(Foo.bar)
def _test_static_method_with_default(self, *args, **kwargs): class Foo(object): @staticmethod def bar(x, y, z=3): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def _test_class_method_with_default(self, *args, **kwargs): class Foo(object): @classmethod def bar(cls, x, y, z=3): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def test_class_method_no_args(self): class Foo(object): @classmethod def bar(cls): pass cliutils.validate_args(Foo.bar)
def _test_bound_method_with_args(self, *args, **kwargs): class Foo: def bar(self, x, y): pass cliutils.validate_args(Foo().bar, *args, **kwargs)
def test_function_no_args(self): def func(): pass cliutils.validate_args(func)
def _test_static_method_with_default(self, *args, **kwargs): class Foo: @staticmethod def bar(x, y, z=3): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def _test_class_method_with_default(self, *args, **kwargs): class Foo: @classmethod def bar(cls, x, y, z=3): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def _test_lambda_with_args(self, *args, **kwargs): cliutils.validate_args(lambda x, y: None, *args, **kwargs)
def test_lambda_no_args(self): cliutils.validate_args(lambda: None)
def _test_class_method_with_args(self, *args, **kwargs): class Foo(object): @classmethod def bar(cls, x, y): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def _test_bound_method_with_default(self, *args, **kwargs): class Foo(object): def bar(self, x, y, z=3): pass cliutils.validate_args(Foo().bar, *args, **kwargs)
def _test_unbound_method_with_args(self, *args, **kwargs): class Foo(object): def bar(self, x, y): pass cliutils.validate_args(Foo.bar, Foo(), *args, **kwargs)
def test_bound_method_no_args(self): class Foo(object): def bar(self): pass cliutils.validate_args(Foo().bar)
def _test_static_method_with_args(self, *args, **kwargs): class Foo(object): @staticmethod def bar(x, y): pass cliutils.validate_args(Foo.bar, *args, **kwargs)
def test_unbound_method_no_args(self): class Foo: def bar(self): pass cliutils.validate_args(Foo.bar, Foo())
def _test_unbound_method_with_default(self, *args, **kwargs): class Foo: def bar(self, x, y, z=3): pass cliutils.validate_args(Foo.bar, Foo(), *args, **kwargs)
def test_class_method_no_args(self): class Foo: @classmethod def bar(cls): pass cliutils.validate_args(Foo.bar)
def _test_lambda_with_default(self, *args, **kwargs): cliutils.validate_args(lambda x, y, z=3: None, *args, **kwargs)
def test_static_method_no_args(self): class Foo: @staticmethod def bar(): pass cliutils.validate_args(Foo.bar)
def _test_function_with_args(self, *args, **kwargs): def func(x, y): pass cliutils.validate_args(func, *args, **kwargs)