def setUp(self): """ This function will create foreign data wrapper, foreign server and foreign table. """ super(ForeignTableGetTestCase, self).setUp() # Load test data self.data = self.test_data # Get parent schema info self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] # Create schema self.schema_name = self.schema_data['schema_name'] self.schema_id = self.schema_data['schema_id'] # Create FDW, server & table self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8]) self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name)
def setUp(self): """ This function will create foreign data wrapper, foreign server and foreign table. """ super(ForeignTableDeleteMultipleTestCase, self).setUp() self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.schema_id = self.schema_data['schema_id'] self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8]) self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name) self.ft_ids = [ft_utils.create_foreign_table( self.server, self.db_name, self.schema_name, self.fsrv_name, "ft_%s" % (str(uuid.uuid4())[1:8])), ft_utils.create_foreign_table( self.server, self.db_name, self.schema_name, self.fsrv_name, "ft_%s" % (str(uuid.uuid4())[1:8])) ]
def setUp(self): """ This function will create foreign data wrapper, foreign server and foreign table. """ super(ForeignTableGetTestCase, self).setUp() # Load test data self.data = self.test_data # Get parent schema info self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] # Create schema self.schema_name = self.schema_data['schema_name'] self.schema_id = self.schema_data['schema_id'] # Create FDW, server & table self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8]) self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name) if bool(self.inventory_data): query = self.inventory_data['query'] self.ft_id = ft_utils.create_foreign_table(self.server, self.db_name, self.schema_name, self.fsrv_name, self.ft_name, query) else: self.ft_id = ft_utils.create_foreign_table(self.server, self.db_name, self.schema_name, self.fsrv_name, self.ft_name) # In case of multiple foreign tables if self.is_list: self.ft_name_2 = "ft_%s" % (str(uuid.uuid4())[1:8]) self.ft_id_2 = ft_utils.create_foreign_table(self.server, self.db_name, self.schema_name, self.fsrv_name, self.ft_name_2) self.data['ids'] = [self.ft_id, self.ft_id_2]
def setUp(self): """ This function will create extension and foreign data wrapper.""" self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.extension_name = "cube" self.fdw_name = "fdw_{0}".format(str(uuid.uuid4())[1:6]) self.extension_id = extension_utils.create_extension( self.server, self.db_name, self.extension_name, self.schema_name) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name)
def setUp(self): """ This function will create extension and foreign data wrapper.""" super(ForeignServerAddTestCase, self).setUp() self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.extension_name = "cube" self.fdw_name = "fdw_{0}".format(str(uuid.uuid4())[1:8]) self.extension_id = extension_utils.create_extension( self.server, self.db_name, self.extension_name, self.schema_name) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name)
def setUp(self): """ This function will create extension and foreign data wrapper.""" super(ForeignServerDeleteTestCase, self).setUp() self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.fdw_name = "test_fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "test_fsrv_%s" % (str(uuid.uuid4())[1:8]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name)
def setUp(self): """ This function will create foreign data wrapper and foreign server. """ self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.schema_id = self.schema_data['schema_id'] self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:4]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:4]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name)
def setUp(self): """ This function will create extension and foreign data wrapper.""" super(UserMappingDependentsAndDependencyTestCase, self).setUp() self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name) self.um_id = um_utils.create_user_mapping(self.server, self.db_name, self.fsrv_name)
def setUp(self): """ This function will create foreign data wrapper and foreign server. """ super(ForeignTableAddTestCase, self).setUp() self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.schema_id = self.schema_data['schema_id'] self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8]) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name) self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8])
def setUp(self): """ This function will create extension and foreign data wrapper.""" super(UserMappingGetTestCase, self).setUp() self.schema_data = parent_node_dict['schema'][-1] self.server_id = self.schema_data['server_id'] self.db_id = self.schema_data['db_id'] self.db_name = parent_node_dict["database"][-1]["db_name"] self.schema_name = self.schema_data['schema_name'] self.extension_name = "cube" self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8]) self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8]) self.extension_id = extension_utils.create_extension( self.server, self.db_name, self.extension_name, self.schema_name) self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name, self.fdw_name) self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name, self.fsrv_name, self.fdw_name) self.um_id = um_utils.create_user_mapping(self.server, self.db_name, self.fsrv_name)