#NEWLINE# def test_agent_summary( self ) : #NEWLINE# #INDENT# aggregator = traffic . TrafficAggregator ( None ) #NEWLINE# original = { #NEWLINE# #INDENT# 'stderr' : '' , #NEWLINE# 'stdout' : '' , #NEWLINE# 'meta' : [ [ 'time' , 's' ] , [ 'Ping ICMP' , 'ms' ] , [ 'TCP download' , 'bit/s' ] ] , #NEWLINE# 'samples' : [ [ 0 , 1.9 , None ] , [ 1 , 2.4 , None ] , [ 2 , 2.6 , ( ( 60 * 1024 ) * 1024 ) ] , [ 3 , 2.2 , ( ( 65 * 1024 ) * 1024 ) ] , [ 4 , 2.2 , ( ( 61 * 1024 ) * 1024 ) ] , [ 5 , 1.9 , None ] ] , #NEWLINE# #UNINDENT# } #NEWLINE# processed = copy . deepcopy ( original ) #NEWLINE# aggregator . record_summary ( processed ) #NEWLINE# self . assertFalse ( ( 'stdout' in processed ) ) #NEWLINE# expected_stats = { #NEWLINE# #INDENT# 'Ping ICMP' : { #NEWLINE# #INDENT# 'max' : 2.6 , #NEWLINE# 'min' : 1.9 , #NEWLINE# 'avg' : 2.2 , #NEWLINE# 'unit' : 'ms' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'TCP download' : { #NEWLINE# #INDENT# 'max' : 65.0 , #NEWLINE# 'min' : 60.0 , #NEWLINE# 'avg' : 62.0 , #NEWLINE# 'unit' : 'Mbit/s' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( processed , processed [ 'stats' ] )