예제 #1
0
 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())
예제 #2
0
 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)
예제 #3
0
파일: UtilsUT.py 프로젝트: rta-pipe/RTAlib
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