本文整理汇总了Python中job.Job.label方法的典型用法代码示例。如果您正苦于以下问题:Python Job.label方法的具体用法?Python Job.label怎么用?Python Job.label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类job.Job
的用法示例。
在下文中一共展示了Job.label方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_submit_job_to_ptburn_with_audio
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import label [as 别名]
def test_submit_job_to_ptburn_with_audio(self, label_patch, required_files,
glob_patch):
required_files.return_value = True
label = Mock(sermon_title="title", date=datetime.date(2014,1,1),
day="SUN, AM", minister="H.L. Sheppard")
label.get_label_key.return_value = "010114PM"
glob_patch.return_value = ["one.mp3", "two.mp3"]
new_job = Job(1, self.connection)
new_job.printonly = False
new_job.label = label
new_job.submit_job_to_ptburn("/audio/", "/labels/","/tmp/")
self.assertTrue(os.path.exists("/tmp/JOB_1.jrq"))
job_file = open("/tmp/JOB_1.jrq").readlines()
self.assertEquals(len(job_file), 11)
self.assertTrue("JobID = 1\n" in job_file)
self.assertTrue("VolumeName = 010114PM\n" in job_file)
self.assertTrue("AudioFile = one.mp3\n" in job_file)
self.assertTrue("AudioFile = two.mp3\n" in job_file)
self.assertTrue("CloseDisc = YES\n" in job_file)
self.assertTrue("Copies = 1\n" in job_file)
self.assertTrue("PrintLabel = /labels/cd-label.std\n" in job_file)
self.assertTrue("MergeField = title\n" in job_file)
self.assertTrue("MergeField = 01/01/2014\n" in job_file)
self.assertTrue("MergeField = SUN, AM\n" in job_file)
self.assertTrue("MergeField = H.L. Sheppard\n" in job_file)
示例2: test_submit_job_to_ptburn_print_only
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import label [as 别名]
def test_submit_job_to_ptburn_print_only(self, label_patch, required_files):
required_files.return_value = False
label = Mock(sermon_title="title", date=datetime.date(2014,1,1),
day="SUN, AM", minister="H.L. Sheppard")
new_job = Job(1, self.connection)
new_job.printonly = True
new_job.label = label
new_job.submit_job_to_ptburn("/audio/", "/labels/","/tmp/")
self.assertTrue(os.path.exists("/tmp/JOB_1.jrq"))
job_file = open("/tmp/JOB_1.jrq").readlines()
self.assertEquals(len(job_file), 7)
self.assertTrue("JobID = 1\n" in job_file)
self.assertTrue("Copies = 1\n" in job_file)
self.assertTrue("PrintLabel = /labels/cd-label.std\n" in job_file)
self.assertTrue("MergeField = title\n" in job_file)
self.assertTrue("MergeField = 01/01/2014\n" in job_file)
self.assertTrue("MergeField = SUN, AM\n" in job_file)
self.assertTrue("MergeField = H.L. Sheppard\n" in job_file)