#NEWLINE# def test_add_iteration_and_render( self ) : #NEWLINE# #INDENT# self . assertRaises ( TypeError , charts . AvgChart , { #NEWLINE# #INDENT# 'iterations_count' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# chart = self . AvgChart ( { #NEWLINE# #INDENT# 'iterations_count' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertIsInstance ( chart , charts . AvgChart ) #NEWLINE# [ chart . add_iteration ( { #NEWLINE# #INDENT# 'foo' : x , #NEWLINE# #UNINDENT# } ) for x in ( { #NEWLINE# #INDENT# 'a' : 1.3 , #NEWLINE# 'b' : 4.3 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'a' : 2.4 , #NEWLINE# 'b' : 5.4 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'a' : 3.5 , #NEWLINE# 'b' : 7.7 , #NEWLINE# #UNINDENT# } ) ] #NEWLINE# self . assertEqual ( [ ( 'a' , 2.4 ) , ( 'b' , 5.8 ) ] , sorted ( chart . render ( ) ) )