Beispiel #1
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)
Beispiel #2
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)
Beispiel #3
0
    def test_class_method_no_args(self):
        class Foo(object):
            @classmethod
            def bar(cls):
                pass

        cliutils.validate_args(Foo.bar)
Beispiel #4
0
    def test_static_method_no_args(self):
        class Foo(object):
            @staticmethod
            def bar():
                pass

        cliutils.validate_args(Foo.bar)
Beispiel #5
0
    def _test_bound_method_with_args(self, *args, **kwargs):
        class Foo(object):
            def bar(self, x, y):
                pass

        cliutils.validate_args(Foo().bar, *args, **kwargs)
Beispiel #6
0
    def _test_function_with_default(self, *args, **kwargs):
        def func(x, y, z=3):
            pass

        cliutils.validate_args(func, *args, **kwargs)
Beispiel #7
0
    def test_function_no_args(self):
        def func():
            pass

        cliutils.validate_args(func)
Beispiel #8
0
 def _test_lambda_with_default(self, *args, **kwargs):
     cliutils.validate_args(lambda x, y, z=3: None, *args, **kwargs)
Beispiel #9
0
 def _test_lambda_with_args(self, *args, **kwargs):
     cliutils.validate_args(lambda x, y: None, *args, **kwargs)
Beispiel #10
0
 def test_function_no_args(self):
     def func():
         pass
     cliutils.validate_args(func)
Beispiel #11
0
 def test_static_method_no_args(self):
     class Foo(object):
         @staticmethod
         def bar():
             pass
     cliutils.validate_args(Foo.bar)
Beispiel #12
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)
Beispiel #13
0
 def test_class_method_no_args(self):
     class Foo(object):
         @classmethod
         def bar(cls):
             pass
     cliutils.validate_args(Foo.bar)
Beispiel #14
0
 def _test_unbound_method_with_default(self, *args, **kwargs):
     class Foo(object):
         def bar(self, x, y, z=3):
             pass
     cliutils.validate_args(Foo.bar, Foo(), *args, **kwargs)
Beispiel #15
0
 def test_unbound_method_no_args(self):
     class Foo(object):
         def bar(self):
             pass
     cliutils.validate_args(Foo.bar, Foo())
Beispiel #16
0
 def _test_bound_method_with_args(self, *args, **kwargs):
     class Foo(object):
         def bar(self, x, y):
             pass
     cliutils.validate_args(Foo().bar, *args, **kwargs)
Beispiel #17
0
 def _test_function_with_default(self, *args, **kwargs):
     def func(x, y, z=3):
         pass
     cliutils.validate_args(func, *args, **kwargs)
Beispiel #18
0
    def test_unbound_method_no_args(self):
        class Foo(object):
            def bar(self):
                pass

        cliutils.validate_args(Foo.bar, Foo())
Beispiel #19
0
    def _test_unbound_method_with_default(self, *args, **kwargs):
        class Foo(object):
            def bar(self, x, y, z=3):
                pass

        cliutils.validate_args(Foo.bar, Foo(), *args, **kwargs)
Beispiel #20
0
 def _test_lambda_with_args(self, *args, **kwargs):
     cliutils.validate_args(lambda x, y: None, *args, **kwargs)
Beispiel #21
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)
Beispiel #22
0
 def _test_lambda_with_default(self, *args, **kwargs):
     cliutils.validate_args(lambda x, y, z=3: None, *args, **kwargs)
Beispiel #23
0
 def test_lambda_no_args(self):
     cliutils.validate_args(lambda: None)
Beispiel #24
0
 def test_lambda_no_args(self):
     cliutils.validate_args(lambda: None)