Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
    def test_static_method_no_args(self):
        class Foo(object):
            @staticmethod
            def bar():
                pass

        cliutils.validate_args(Foo.bar)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 6
0
    def test_class_method_no_args(self):
        class Foo(object):
            @classmethod
            def bar(cls):
                pass

        cliutils.validate_args(Foo.bar)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 18
0
    def test_bound_method_no_args(self):
        class Foo(object):
            def bar(self):
                pass

        cliutils.validate_args(Foo().bar)
Exemplo n.º 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)
Exemplo n.º 20
0
 def test_lambda_no_args(self):
     cliutils.validate_args(lambda: None)
Exemplo n.º 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)
Exemplo n.º 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())
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 34
0
 def test_bound_method_no_args(self):
     class Foo(object):
         def bar(self):
             pass
     cliutils.validate_args(Foo().bar)