def test_influxdb_create_database(self, m_query): default_database = 'my_db' self.client = InfluxClient(default_host="192.168.1.40", default_port=8087, default_database=default_database, default_username="******", default_password="******", create_database=True) self.client.connect() assert self.client.store_endpoint m_query.assert_called_with('CREATE DATABASE %s' % default_database)
def setUp(self): super(TestInfluxDBClient, self).setUp() self.conf = cfg.ConfigOpts() self.useFixture(ConfFixture(self.conf)) self.patches.extend([]) for _patch in self.patches: _patch.start() self.client = InfluxClient(default_host="192.168.1.40", default_port=8087, default_database="my_db", default_username="******", default_password="******", create_database=False)