#NEWLINE# def _test_color_function( self ) : #NEWLINE# #INDENT# if ( not callable ( self . f ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Color function is not callable.' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# result = self . f ( 0 , 0 , 0 , 0 , 0 ) #NEWLINE# if ( len ( result ) != 3 ) : #NEWLINE# #INDENT# raise ValueError ( 'length should be equal to 3' ) #NEWLINE# #UNINDENT# #UNINDENT# except TypeError as te : #NEWLINE# #INDENT# raise ValueError ( "Color function needs to accept x,y,z,u,v, as arguments even if it doesn't use all of them." ) #NEWLINE# #UNINDENT# except AssertionError as ae : #NEWLINE# #INDENT# raise ValueError ( 'Color function needs to return 3-tuple r,g,b.' ) #NEWLINE# #UNINDENT# except Exception as ie : #NEWLINE# #INDENT# pass