当前位置: 首页>>代码示例>>Python>>正文


Python Job.printonly方法代码示例

本文整理汇总了Python中job.Job.printonly方法的典型用法代码示例。如果您正苦于以下问题:Python Job.printonly方法的具体用法?Python Job.printonly怎么用?Python Job.printonly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在job.Job的用法示例。


在下文中一共展示了Job.printonly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_submit_job_to_ptburn_with_audio

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import printonly [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)
开发者ID:cplazas,项目名称:church-scripts,代码行数:30,代码来源:test_job.py

示例2: test_submit_job_to_ptburn_print_only

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import printonly [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)
开发者ID:cplazas,项目名称:church-scripts,代码行数:23,代码来源:test_job.py


注:本文中的job.Job.printonly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。