def test_connect_access(self): config_file = f"{self.config_folder}/confs_sqlite.ini" config_object = ConfiguresReader(config_file) section = config_object.read_section('db') self._notempty_ini(section, 'filebase') username, password, dbname, port, ip, path, version, sde_engine = config_object.format_for_dbconnector( ) MSAccessConnector(path=path, version=version, sde_engine=sde_engine)
def test_connect_mongo(self): config_file = f"{self.config_folder}/confs_mongo.ini" config_object = ConfiguresReader(config_file) section = config_object.read_section('db') self._notempty_ini(section, 'nosql') username, password, dbname, port, ip, path, version, sde_engine = config_object.format_for_dbconnector( ) MongoConnector(username, password, dbname, port, ip)
def test_connect_postgres(self): config_file = f"{self.config_folder}/confs_postgres.ini" config_object = ConfiguresReader(config_file) section = config_object.read_section('db') self._notempty_ini(section, 'rdbms') username, password, dbname, port, ip, path, version, sde_engine = config_object.format_for_dbconnector( ) PostgreSQLConnector(username, password, dbname, port, ip, version=version, sde_engine=sde_engine)
def test_connect_sqlserver(self): config_file = f"{self.config_folder}/confs_sqlserver.ini" config_object = ConfiguresReader(config_file) section = config_object.read_section('db') self._notempty_ini(section, 'rdbms') username, password, dbname, port, ip, path, version, sde_engine = config_object.format_for_dbconnector( ) SQLServerConnector(username, password, dbname, port, ip, version=version, sde_engine=sde_engine, start=True)
def config_read(self): if not isfile(self.__config__): print( f"config dosyası {self.__config__} pathinde bulunamadı. SQLite kullanılacak." ) return None else: return ConfiguresReader(self.__config__)