예제 #1
0
    def test_class_function_no_args(self):
        class TestClass(object):
            def func(self):
                pass

        self.assertFalse(has_required_args(TestClass.func))
예제 #2
0
    def test_simple_2_arg_function_with_one_default(self):
        def testfunc(foo, bar=3):
            pass

        self.assertTrue(has_required_args(testfunc))
예제 #3
0
    def test_simple_2_arg_function_with_two_defaults(self):
        def testfunc(foo=1, bar=3):
            pass

        self.assertFalse(has_required_args(testfunc))
예제 #4
0
    def test_simple_1_arg_function_with_default(self):
        def testfunc(foo=2):
            pass

        self.assertFalse(has_required_args(testfunc))
예제 #5
0
    def test_simple_2_arg_function(self):
        def testfunc(foo, bar):
            pass

        self.assertTrue(has_required_args(testfunc))
예제 #6
0
    def test_class_function_2_args_1_default(self):
        class TestClass(object):
            def func(self, foo, bar=2):
                pass

        self.assertTrue(has_required_args(TestClass.func))
예제 #7
0
 def test_simple_2_arg_function(self):
     def testfunc(foo, bar):
         pass
     self.assertTrue(has_required_args(testfunc))
예제 #8
0
 def test_class_function_2_args_1_default(self):
     class TestClass(object):
         def func(self, foo, bar=2):
             pass
     self.assertTrue(has_required_args(TestClass.func))
예제 #9
0
 def test_class_function_2_args_2_defaults(self):
     class TestClass(object):
         def func(self, foo=1, bar=2):
             pass
     self.assertFalse(has_required_args(TestClass.func))
예제 #10
0
 def test_class_function_1_arg(self):
     class TestClass(object):
         def func(self, foo):
             pass
     self.assertTrue(has_required_args(TestClass.func))
예제 #11
0
 def test_class_function_1_arg_with_default(self):
     class TestClass(object):
         def func(self, foo=2):
             pass
     self.assertFalse(has_required_args(TestClass.func))
예제 #12
0
 def test_class_function_no_args(self):
     class TestClass(object):
         def func(self):
             pass
     self.assertFalse(has_required_args(TestClass.func))
예제 #13
0
 def test_simple_2_arg_function_with_two_defaults(self):
     def testfunc(foo=1, bar=3):
         pass
     self.assertFalse(has_required_args(testfunc))
예제 #14
0
 def test_simple_2_arg_function_with_one_default(self):
     def testfunc(foo, bar=3):
         pass
     self.assertTrue(has_required_args(testfunc))
예제 #15
0
    def test_class_function_1_arg(self):
        class TestClass(object):
            def func(self, foo):
                pass

        self.assertTrue(has_required_args(TestClass.func))
예제 #16
0
 def test_simple_no_args_function(self):
     def testfunc():
         pass
     self.assertFalse(has_required_args(testfunc))
예제 #17
0
    def test_class_function_1_arg_with_default(self):
        class TestClass(object):
            def func(self, foo=2):
                pass

        self.assertFalse(has_required_args(TestClass.func))
예제 #18
0
    def test_simple_no_args_function(self):
        def testfunc():
            pass

        self.assertFalse(has_required_args(testfunc))
예제 #19
0
    def test_class_function_2_args_2_defaults(self):
        class TestClass(object):
            def func(self, foo=1, bar=2):
                pass

        self.assertFalse(has_required_args(TestClass.func))
예제 #20
0
 def test_simple_1_arg_function_with_default(self):
     def testfunc(foo=2):
         pass
     self.assertFalse(has_required_args(testfunc))