async def test_create_data_feed_with_influxdb(self):
        name = self.create_random_name("influxdbasync")
        async with self.admin_client:
            try:
                data_feed = await self.admin_client.create_data_feed(
                    name=name,
                    source=InfluxDbDataFeedSource(
                        connection_string=self.influxdb_connection_string,
                        database="adsample",
                        user_name="adreadonly",
                        password=self.influxdb_password,
                        query="'select * from adsample2 where Timestamp = @StartTime'"
                    ),
                    granularity=DataFeedGranularity(
                        granularity_type="Daily",
                    ),
                    schema=DataFeedSchema(
                        metrics=[
                            DataFeedMetric(name="cost"),
                            DataFeedMetric(name="revenue")
                        ],
                        dimensions=[
                            DataFeedDimension(name="category"),
                            DataFeedDimension(name="city")
                        ],
                    ),
                    ingestion_settings=DataFeedIngestionSettings(
                        ingestion_begin_time=datetime.datetime(2019, 1, 1),
                    ),

                )

                self.assertIsNotNone(data_feed.id)
                self.assertIsNotNone(data_feed.created_time)
                self.assertIsNotNone(data_feed.name)
                self.assertEqual(data_feed.source.data_source_type, "InfluxDB")
                self.assertIsNotNone(data_feed.source.query)
                self.assertEqual(data_feed.source.database, "adsample")
                self.assertEqual(data_feed.source.user_name, "adreadonly")

            finally:
                await self.admin_client.delete_data_feed(data_feed.id)
    def test_create_data_feed_with_influxdb(self, client, variables):
        name = self.create_random_name("influxdb")
        if self.is_live:
            variables["data_feed_name"] = name
        try:
            data_feed = client.create_data_feed(
                name=variables["data_feed_name"],
                source=InfluxDbDataFeedSource(
                    connection_string="influxdb_connection_string",
                    database="adsample",
                    user_name="adreadonly",
                    password="******",
                    query=
                    "'select * from adsample2 where Timestamp = @StartTime'"),
                granularity=DataFeedGranularity(granularity_type="Daily", ),
                schema=DataFeedSchema(
                    metrics=[
                        DataFeedMetric(name="cost"),
                        DataFeedMetric(name="revenue")
                    ],
                    dimensions=[
                        DataFeedDimension(name="category"),
                        DataFeedDimension(name="city")
                    ],
                ),
                ingestion_settings=DataFeedIngestionSettings(
                    ingestion_begin_time=datetime.datetime(2019, 1, 1), ),
            )
            if self.is_live:
                variables["data_feed_id"] = data_feed.id
            assert data_feed.id is not None
            assert data_feed.created_time is not None
            assert data_feed.name is not None
            assert data_feed.source.data_source_type == "InfluxDB"
            assert data_feed.source.query is not None
            assert data_feed.source.database == "adsample"
            assert data_feed.source.user_name == "adreadonly"

        finally:
            self.clean_up(client.delete_data_feed, variables)
        return variables