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


Python JobDefinition.create_child_job_from_record方法代码示例

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


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

示例1: test_via_does_not_change_checksum

# 需要导入模块: from plainbox.impl.job import JobDefinition [as 别名]
# 或者: from plainbox.impl.job.JobDefinition import create_child_job_from_record [as 别名]
 def test_via_does_not_change_checksum(self):
     parent = JobDefinition({'name': 'parent', 'plugin': 'local'})
     child = parent.create_child_job_from_record(
         RFC822Record({'name': 'test', 'plugin': 'shell'}, None))
     helper = JobDefinition({'name': 'test', 'plugin': 'shell'})
     self.assertEqual(child.via, parent.get_checksum())
     self.assertEqual(child.get_checksum(), helper.get_checksum())
开发者ID:jeffmarcom,项目名称:checkbox,代码行数:9,代码来源:test_job.py

示例2: test_via_does_not_change_checksum

# 需要导入模块: from plainbox.impl.job import JobDefinition [as 别名]
# 或者: from plainbox.impl.job.JobDefinition import create_child_job_from_record [as 别名]
 def test_via_does_not_change_checksum(self):
     """
     verify that the 'via' attribute in no way influences job checksum
     """
     # Create a 'parent' job
     parent = JobDefinition({'name': 'parent', 'plugin': 'local'})
     # Create a 'child' job, using create_child_job_from_record() should
     # time the two so that child.via should be parent.checksum.
     #
     # The elaborate record that gets passed has all the meta-data that
     # traces back to the 'parent' job (as well as some imaginary line_start
     # and line_end values for the purpose of the test).
     child = parent.create_child_job_from_record(
         RFC822Record(
             data={'name': 'test', 'plugin': 'shell'},
             origin=Origin(
                 source=JobOutputTextSource(parent),
                 line_start=1,
                 line_end=1)))
     # Now 'child.via' should be the same as 'parent.checksum'
     self.assertEqual(child.via, parent.checksum)
     # Create an unrelated job 'helper' with the definition identical as
     # 'child' but without any ties to the 'parent' job
     helper = JobDefinition({'name': 'test', 'plugin': 'shell'})
     # And again, child.checksum should be the same as helper.checksum
     self.assertEqual(child.checksum, helper.checksum)
开发者ID:brendan-donegan,项目名称:checkbox,代码行数:28,代码来源:test_job.py

示例3: test_via_does_not_change_checksum

# 需要导入模块: from plainbox.impl.job import JobDefinition [as 别名]
# 或者: from plainbox.impl.job.JobDefinition import create_child_job_from_record [as 别名]
 def test_via_does_not_change_checksum(self):
     parent = JobDefinition({"name": "parent", "plugin": "local"})
     child = parent.create_child_job_from_record(RFC822Record({"name": "test", "plugin": "shell"}, None))
     helper = JobDefinition({"name": "test", "plugin": "shell"})
     self.assertEqual(child.via, parent.get_checksum())
     self.assertEqual(child.get_checksum(), helper.get_checksum())
开发者ID:jds2001,项目名称:ocp-checkbox,代码行数:8,代码来源:test_job.py


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