Exemple #1
0
    def test_get_function_argspec(self):
        def dummy_func(first, second, third, fourth='fifth'):
            pass

        expected_argspec = namedtuple('ArgSpec', 'args varargs keywords defaults')(
            args=['first', 'second', 'third', 'fourth'], varargs=None, keywords=None, defaults=('fifth',))
        ret = utils.get_function_argspec(dummy_func)

        self.assertEqual(ret, expected_argspec)
Exemple #2
0
    def test_get_function_argspec(self):
        def dummy_func(first, second, third, fourth='fifth'):
            pass

        expected_argspec = namedtuple('ArgSpec', 'args varargs keywords defaults')(
            args=['first', 'second', 'third', 'fourth'], varargs=None, keywords=None, defaults=('fifth',))
        ret = utils.get_function_argspec(dummy_func)

        self.assertEqual(ret, expected_argspec)
Exemple #3
0
    def test_get_function_argspec(self):
        def dummy_func(first, second, third, fourth="fifth"):
            pass

        expected_argspec = namedtuple("ArgSpec", "args varargs keywords defaults")(
            args=["first", "second", "third", "fourth"], varargs=None, keywords=None, defaults=("fifth",)
        )
        ret = utils.get_function_argspec(dummy_func)

        self.assertEqual(ret, expected_argspec)