本文整理汇总了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())
示例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)
示例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())