def test_connection(self): config = Config(config_file_path) config.reload(config_file_path) config.set('General', 'debug', 'yes') rta_evt3_db_mysql = RTA_EVT3_DB('mysql', config_file_path) rta_evt3_db_redis = RTA_EVT3_DB('redis-basic', config_file_path) self.assertEqual(True, rta_evt3_db_mysql.dbConnector.testConnection()) self.assertEqual(True, rta_evt3_db_redis.dbConnector.testConnection())
def test_singleton(self): config = Config(config_file_path) config.set('General', 'batchsize', 666) config = Config(config_file_path) self.assertEqual(666, config.get('General', 'batchsize')) config.reload(config_file_path)
def getConfig(config_file_path, debug, reload=False): config = Config(config_file_path) if reload: config.reload(config_file_path) config.set('General', 'debug', debug) return config