#NEWLINE# def test_validation_checking( self ) : #NEWLINE# #INDENT# 'Visualization fields are grammar-checked' #NEWLINE# grammar_errors = [ ( 'width' , ( - 1 ) , ValueError , 'width cannot be negative' ) , ( 'height' , ( - 1 ) , ValueError , 'height cannot be negative' ) , ( 'viewport' , [ 1 ] , ValueError , 'viewport must have 2 dimensions' ) , ( 'viewport' , [ ( - 1 ) , ( - 1 ) ] , ValueError , 'viewport dimensions cannot be negative' ) , ( 'padding' , { #NEWLINE# #INDENT# 'top' : 2 , #NEWLINE# #UNINDENT# } , ValueError , 'Padding must have keys "top", "left", "right", "bottom".' ) , ( 'padding' , { #NEWLINE# #INDENT# 'top' : 1 , #NEWLINE# 'left' : 1 , #NEWLINE# 'right' : 1 , #NEWLINE# 'bottom' : ( - 1 ) , #NEWLINE# #UNINDENT# } , ValueError , 'Padding cannot be negative.' ) , ( 'padding' , ( - 1 ) , ValueError , 'Padding cannot be negative.' ) ] #NEWLINE# assert_grammar_validation ( grammar_errors , Visualization ( ) )