#NEWLINE# @ mock . patch ( 'influxdb.helper.SeriesHelper._current_timestamp' ) #NEWLINE# def testSeveralSeriesNames( self , current_timestamp ) : #NEWLINE# #INDENT# '\n        Tests JSON conversion when there are multiple series names.\n        ' #NEWLINE# current_timestamp . return_value = current_date = datetime . today ( ) #NEWLINE# TestSeriesHelper . MySeriesHelper ( server_name = 'us.east-1' , some_stat = 159 , other_tag = 'ello' ) #NEWLINE# TestSeriesHelper . MySeriesHelper ( server_name = 'fr.paris-10' , some_stat = 158 , other_tag = 'ello' ) #NEWLINE# TestSeriesHelper . MySeriesHelper ( server_name = 'lu.lux' , some_stat = 157 , other_tag = 'ello' ) #NEWLINE# TestSeriesHelper . MySeriesHelper ( server_name = 'uk.london' , some_stat = 156 , other_tag = 'ello' ) #NEWLINE# expectation = [ { #NEWLINE# #INDENT# 'fields' : { #NEWLINE# #INDENT# 'some_stat' : 157 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'measurement' : 'events.stats.lu.lux' , #NEWLINE# 'tags' : { #NEWLINE# #INDENT# 'other_tag' : 'ello' , #NEWLINE# 'server_name' : 'lu.lux' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'time' : rcvd , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'fields' : { #NEWLINE# #INDENT# 'some_stat' : 156 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'measurement' : 'events.stats.uk.london' , #NEWLINE# 'tags' : { #NEWLINE# #INDENT# 'other_tag' : 'ello' , #NEWLINE# 'server_name' : 'uk.london' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'time' : current_date , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'fields' : { #NEWLINE# #INDENT# 'some_stat' : 158 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'measurement' : 'events.stats.fr.paris-10' , #NEWLINE# 'tags' : { #NEWLINE# #INDENT# 'other_tag' : 'ello' , #NEWLINE# 'server_name' : 'fr.paris-10' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'time' : current_date , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'fields' : { #NEWLINE# #INDENT# 'some_stat' : 159 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'measurement' : 'events.stats.us.east-1' , #NEWLINE# 'tags' : { #NEWLINE# #INDENT# 'other_tag' : 'ello' , #NEWLINE# 'server_name' : 'us.east-1' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'time' : current_date , #NEWLINE# #UNINDENT# } ] #NEWLINE# rcvd = TestSeriesHelper . MySeriesHelper . _json_body_ ( ) #NEWLINE# self . assertTrue ( ( all ( [ ( el in expectation ) for el in rcvd ] ) and all ( [ ( el in rcvd ) for el in expectation ] ) ) , 'Invalid JSON body of time series returned from _json_body_ for several series names: {0}.' . format ( rcvd ) )