Exemplo n.º 1
0
 def test_influx_service_not_inited(self):
     self.setUpLogging()
     self.patch(storage_backends, 'InfluxDBClient', fakestats.FakeInfluxDBClient)
     svc = InfluxStorageService(
         "fake_url", "fake_port", "fake_user", "fake_password", "fake_db", "fake_stats")
     svc.inited = False
     svc.postStatsValue("test", "test", "test")
     self.assertLogged("Service.*not initialized")
Exemplo n.º 2
0
 def test_influx_storage_service_post_value(self):
     # test the postStatsValue method of InfluxStorageService
     self.patch(storage_backends, 'InfluxDBClient', fakestats.FakeInfluxDBClient)
     svc = InfluxStorageService(
         "fake_url", "fake_port", "fake_user", "fake_password", "fake_db", "fake_stats")
     post_data = {
         'name': 'test',
         'value': 'test'
     }
     svc.postStatsValue(post_data, "test_series_name")
     data = {}
     data['name'] = "test_series_name"
     data['fields'] = {
         "name": "test",
         "value": "test"
     }
     data['tags'] = {}
     points = [data]
     self.assertEquals(svc.client.points, points)