Example #1
0
    def _test_static_method_with_args(self, *args, **kwargs):
        class Foo:
            @staticmethod
            def bar(x, y):
                pass

        cliutils.validate_args(Foo.bar, *args, **kwargs)
Example #2
0
    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)
Example #3
0
    def test_static_method_no_args(self):
        class Foo(object):
            @staticmethod
            def bar():
                pass

        cliutils.validate_args(Foo.bar)
Example #4
0
    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)
Example #5
0
    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)
Example #6
0
    def test_class_method_no_args(self):
        class Foo(object):
            @classmethod
            def bar(cls):
                pass

        cliutils.validate_args(Foo.bar)
Example #7
0
 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_bound_method_with_args(self, *args, **kwargs):
     class Foo:
         def bar(self, x, y):
             pass
     cliutils.validate_args(Foo().bar, *args, **kwargs)
Example #14
0
 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)
Example #15
0
 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)
Example #16
0
    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)
Example #17
0
    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)
Example #18
0
    def test_bound_method_no_args(self):
        class Foo(object):
            def bar(self):
                pass

        cliutils.validate_args(Foo().bar)
Example #19
0
 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)
Example #20
0
 def test_lambda_no_args(self):
     cliutils.validate_args(lambda: None)
Example #21
0
 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)
Example #22
0
 def test_unbound_method_no_args(self):
     class Foo:
         def bar(self):
             pass
     cliutils.validate_args(Foo.bar, Foo())
 def test_unbound_method_no_args(self):
     class Foo:
         def bar(self):
             pass
     cliutils.validate_args(Foo.bar, Foo())
Example #24
0
 def _test_lambda_with_args(self, *args, **kwargs):
     cliutils.validate_args(lambda x, y: None, *args, **kwargs)
 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)
Example #26
0
 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)
Example #28
0
 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)
Example #30
0
 def test_function_no_args(self):
     def func():
         pass
     cliutils.validate_args(func)
 def _test_lambda_with_default(self, *args, **kwargs):
     cliutils.validate_args(lambda x, y, z=3: None, *args, **kwargs)
Example #32
0
 def _test_function_with_args(self, *args, **kwargs):
     def func(x, y):
         pass
     cliutils.validate_args(func, *args, **kwargs)
 def _test_function_with_args(self, *args, **kwargs):
     def func(x, y):
         pass
     cliutils.validate_args(func, *args, **kwargs)
Example #34
0
 def test_bound_method_no_args(self):
     class Foo(object):
         def bar(self):
             pass
     cliutils.validate_args(Foo().bar)