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)
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)