本文整理汇总了Python中EDParallelExecute.EDParallelExecute.moveToTempDir方法的典型用法代码示例。如果您正苦于以下问题:Python EDParallelExecute.moveToTempDir方法的具体用法?Python EDParallelExecute.moveToTempDir怎么用?Python EDParallelExecute.moveToTempDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDParallelExecute.EDParallelExecute
的用法示例。
在下文中一共展示了EDParallelExecute.moveToTempDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EDTestCaseParallelExecute
# 需要导入模块: from EDParallelExecute import EDParallelExecute [as 别名]
# 或者: from EDParallelExecute.EDParallelExecute import moveToTempDir [as 别名]
class EDTestCaseParallelExecute(EDTestCase):
"""
Unit & execution test for the EDParallelExecute class
"""
def __init__(self, _strTestName=None):
EDTestCase.__init__(self, "EDTestCaseParallelExecute")
self.__edpluginPE = EDParallelExecute("EDPluginTestPluginFactory", fakeXML)
def unitTestMoveToTempDir(self):
"""
test the execution of self.movetoTempDir
"""
initcwd = os.getcwd()
self.__edpluginPE.moveToTempDir()
EDAssert.equal(os.path.abspath(os.path.dirname(os.getcwd())), os.path.abspath(tempfile.gettempdir()), "Test Move to Temporary Directory...")
os.chdir(initcwd)
def unitTestDetectNumberOfCPUs(self):
"""
test the execution of detectNumberOfCPUs
"""
iNbCPU = EDUtilsParallel.detectNumberOfCPUs()
EDVerbose.unitTest("Detection of the number of Cores: %s" % iNbCPU)
EDAssert.equal(types.IntType, type(iNbCPU), "Number of CPU is an integer")
iNbCPU = EDUtilsParallel.detectNumberOfCPUs(1) #limited to 1
EDAssert.equal(1, iNbCPU, "Limit number of CPU")
iNbCPU = EDUtilsParallel.detectNumberOfCPUs(100, True) #forced to 100
EDAssert.equal(100, iNbCPU, "Force number of CPU")
def process(self):
self.addTestMethod(self.unitTestMoveToTempDir)
self.addTestMethod(self.unitTestDetectNumberOfCPUs)
EDUtilsParallel.uninitializeNbThread()