#NEWLINE# def test_user_defined_function( self ) : #NEWLINE# #INDENT# s = t . amount . count ( ) #NEWLINE# r = compute ( s , data ) #NEWLINE# assert isinstance ( r , int ) #NEWLINE# def myfunc( x ) : #NEWLINE# #INDENT# return ( ( ( cos ( x ) + sin ( x ) ) ** 2 ) / math . pi ) #NEWLINE# #UNINDENT# result = compute ( myfunc ( expected ) , data ) #NEWLINE# expected = ( ( ( math . cos ( r ) + math . sin ( r ) ) ** 2 ) / math . pi ) #NEWLINE# assert ( result == expected )