def test_tags(mock_flux): mock_res = mock.MagicMock() mock_res.get_points.return_value = [{'tagKey': 'sensor_id'}] mock_flux.return_value = mock_res db = influxdb.InfluxDBClient(database="fizz") client = InfluxAlchemy(db) assert client.tags(Measurement.new("environment")) == ["sensor_id"]
def test_tags(mock_flux): mock_res = mock.MagicMock() mock_res.get_points.return_value = [{"name": "fizz"}] mock_flux.return_value = mock_res db = influxdb.InfluxDBClient(database="fizz") client = InfluxAlchemy(db) assert client.tags(Measurement.new("foo")) == ["fizz"]