'Test JSON conversion when there are multiple series names.'

@mock.patch(u'influxdb.helper.SeriesHelper._current_timestamp')
def testSeveralSeriesNames(self, current_timestamp):

    current_timestamp.return_value = current_date = datetime.today()
    TestSeriesHelper.MySeriesHelper(server_name=u'us.east-1', some_stat=159, other_tag=u'ello')
    TestSeriesHelper.MySeriesHelper(server_name=u'fr.paris-10', some_stat=158, other_tag=u'ello')
    TestSeriesHelper.MySeriesHelper(server_name=u'lu.lux', some_stat=157, other_tag=u'ello')
    TestSeriesHelper.MySeriesHelper(server_name=u'uk.london', some_stat=156, other_tag=u'ello')
    expectation = [{u'fields': {u'some_stat': 157}, u'measurement': u'events.stats.lu.lux', u'tags': {u'other_tag': u'ello', u'server_name': u'lu.lux'}, u'time': current_date}, {u'fields': {u'some_stat': 156}, u'measurement': u'events.stats.uk.london', u'tags': {u'other_tag': u'ello', u'server_name': u'uk.london'}, u'time': current_date}, {u'fields': {u'some_stat': 158}, u'measurement': u'events.stats.fr.paris-10', u'tags': {u'other_tag': u'ello', u'server_name': u'fr.paris-10'}, u'time': current_date}, {u'fields': {u'some_stat': 159}, u'measurement': u'events.stats.us.east-1', u'tags': {u'other_tag': u'ello', u'server_name': u'us.east-1'}, u'time': current_date}]
    rcvd = TestSeriesHelper.MySeriesHelper._json_body_()
    self.assertTrue((all([(el in expectation) for el in rcvd]) and all([(el in rcvd) for el in expectation])), u'Invalid    JSON    body    of    time    series    returned    from    _json_body_    for    several    series    names:    {0}.'.format(rcvd))
