#NEWLINE# def test_get_function_args( self ) : #NEWLINE# #INDENT# def func( arg1 , arg2 , arg3 = 42 , arg4 = None , arg5 = 'foo' ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . assertEqual ( [ FunctionArg ( 'arg1' , '' , False , None ) , FunctionArg ( 'arg2' , '' , False , None ) , FunctionArg ( 'arg3' , '' , True , 42 ) , FunctionArg ( 'arg4' , '' , True , None ) , FunctionArg ( 'arg5' , '' , True , 'foo' ) ] , BuildDictionaryInfoExtracter . get_function_args ( func ) ) #NEWLINE# class TestCls ( object ) : #NEWLINE# #INDENT# def __init__( self , arg1 , arg2 = False ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( [ FunctionArg ( 'arg1' , '' , False , None ) , FunctionArg ( 'arg2' , '' , True , False ) ] , BuildDictionaryInfoExtracter . get_function_args ( TestCls . __init__ ) ) #NEWLINE# def generic_func( arg1 , arg2 = 42 , * args , **kwargs ) : #NEWLINE# #INDENT# "\n      :param arg1: The first arg.\n      :param arg2: The second arg.\n      :param args: Some extra varargs.\n      :param arg3: The third arg.\n      :param arg4: The fourth arg (default: 'Foo').\n      " #NEWLINE# #UNINDENT# self . assertEqual ( [ FunctionArg ( 'arg1' , 'The first arg.' , False , None ) , FunctionArg ( 'arg2' , 'The second arg.' , True , 42 ) , FunctionArg ( '*args' , 'Some extra varargs.' , False , None ) , FunctionArg ( 'arg3' , 'The third arg.' , True , None ) , FunctionArg ( 'arg4' , 'The fourth arg.' , True , "'Foo'" ) ] , BuildDictionaryInfoExtracter . get_function_args ( func ) )