本文整理汇总了Python中mpp.lib.config.GPDBConfig.get_count_segments方法的典型用法代码示例。如果您正苦于以下问题:Python GPDBConfig.get_count_segments方法的具体用法?Python GPDBConfig.get_count_segments怎么用?Python GPDBConfig.get_count_segments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpp.lib.config.GPDBConfig
的用法示例。
在下文中一共展示了GPDBConfig.get_count_segments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GPDBConfigRegressionTests
# 需要导入模块: from mpp.lib.config import GPDBConfig [as 别名]
# 或者: from mpp.lib.config.GPDBConfig import get_count_segments [as 别名]
class GPDBConfigRegressionTests(unittest.TestCase):
def __init__(self, methodName):
self.gpconfig = GPDBConfig()
super(GPDBConfigRegressionTests,self).__init__(methodName)
def test_get_countprimarysegments(self):
nprimary = self.gpconfig.get_countprimarysegments()
self.assertTrue(nprimary > 0)
def test_get_hostandport_of_segment(self):
(host,port) = self.gpconfig.get_hostandport_of_segment(psegmentNumber = -1, pRole = 'p')
myhost = socket.gethostname()
self.assertEquals(host, myhost)
def test_get_count_segments(self):
seg_count = self.gpconfig.get_count_segments()
self.assertTrue(seg_count.strip() >0)
def test_seghostnames(self):
hostlist = self.gpconfig.get_hosts()
self.assertTrue(len(hostlist) >0)
def test_hostnames(self):
hostlist = self.gpconfig.get_hosts(segments=False)
self.assertTrue(len(hostlist) >0)
def tes_get_masterhost(self):
master_host = self.gpconfig.get_masterhost()
myhost = socket.gethostname()
self.assertEquals(master_host, myhost)
def test_get_masterdata_directory(self):
master_dd = self.gpconfig.get_masterdata_directory()
my_mdd = os.getenv("MASTER_DATA_DIRECTORY")
self.assertEquals(master_dd, my_mdd)