本文整理汇总了Python中toil.common.Toil.__exit__方法的典型用法代码示例。如果您正苦于以下问题:Python Toil.__exit__方法的具体用法?Python Toil.__exit__怎么用?Python Toil.__exit__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toil.common.Toil
的用法示例。
在下文中一共展示了Toil.__exit__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JobGraphTest
# 需要导入模块: from toil.common import Toil [as 别名]
# 或者: from toil.common.Toil import __exit__ [as 别名]
class JobGraphTest(ToilTest):
def setUp(self):
super(JobGraphTest, self).setUp()
self.jobStorePath = self._getTestJobStorePath()
parser = ArgumentParser()
Job.Runner.addToilOptions(parser)
options = parser.parse_args(args=[self.jobStorePath])
self.toil = Toil(options)
self.assertEquals( self.toil, self.toil.__enter__() )
def tearDown(self):
self.toil.__exit__(None, None, None)
self.toil._jobStore.destroy()
self.assertFalse(os.path.exists(self.jobStorePath))
super(JobGraphTest, self).tearDown()
def testJob(self):
"""
Tests functions of a job.
"""
command = "by your command"
memory = 2^32
disk = 2^32
cores = 1
preemptable = 1
jobStoreID = 100
remainingRetryCount = 5
predecessorNumber = 0
j = JobGraph(command=command, memory=memory, cores=cores, disk=disk, preemptable=preemptable,
jobStoreID=jobStoreID, remainingRetryCount=remainingRetryCount,
predecessorNumber=predecessorNumber, jobName='testJobGraph', unitName='noName')
#Check attributes
#
self.assertEquals(j.command, command)
self.assertEquals(j.memory, memory)
self.assertEquals(j.disk, disk)
self.assertEquals(j.cores, cores)
self.assertEquals(j.preemptable, preemptable)
self.assertEquals(j.jobStoreID, jobStoreID)
self.assertEquals(j.remainingRetryCount, remainingRetryCount)
self.assertEquals(j.predecessorNumber, predecessorNumber)
self.assertEquals(j.stack, [])
self.assertEquals(j.predecessorsFinished, set())
self.assertEquals(j.logJobStoreFileID, None)
#Check equals function
j2 = JobGraph(command=command, memory=memory, cores=cores, disk=disk,
preemptable=preemptable,
jobStoreID=jobStoreID, remainingRetryCount=remainingRetryCount,
predecessorNumber=predecessorNumber, jobName='testJobGraph', unitName='noName')
self.assertEquals(j, j2)
#Change an attribute and check not equal
j.predecessorsFinished = {"1", "2"}
self.assertNotEquals(j, j2)