#NEWLINE# def test_args_from_args_usertype( self ) : #NEWLINE# #INDENT# class FakeType ( UserType ) : #NEWLINE# #INDENT# name = 'fake-type' #NEWLINE# basetype = int #NEWLINE# #UNINDENT# fake_type = FakeType ( ) #NEWLINE# fd = FunctionDefinition ( FunctionDefinition ) #NEWLINE# fd . arguments . append ( FunctionArgument ( 'fake-arg' , fake_type , True , 0 ) ) #NEWLINE# new_args = args_from_args ( fd , [ 1 ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( [ 1 ] , new_args [ 0 ] ) #NEWLINE# try : #NEWLINE# #INDENT# args_from_args ( fd , [ 'invalid-argument' ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except InvalidInput as e : #NEWLINE# #INDENT# assert ( fake_type . name in str ( e ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'Should have thrown an InvalidInput' )