本文整理汇总了Python中pulp.bindings.responses.Task.result方法的典型用法代码示例。如果您正苦于以下问题:Python Task.result方法的具体用法?Python Task.result怎么用?Python Task.result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.bindings.responses.Task
的用法示例。
在下文中一共展示了Task.result方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_succeeded_hands_off_errors
# 需要导入模块: from pulp.bindings.responses import Task [as 别名]
# 或者: from pulp.bindings.responses.Task import result [as 别名]
def test_succeeded_hands_off_errors(self, mock_render):
task = Task(self.TASK_TEMPLATE)
task.result = {
'details': self._generate_details({'errors': {'foo/bar': {}}}),
'num_changes': 1
}
self.command.succeeded('', task)
mock_render.assert_called_once_with(task.result)
示例2: test_succeeded_one_change
# 需要导入模块: from pulp.bindings.responses import Task [as 别名]
# 或者: from pulp.bindings.responses.Task import result [as 别名]
def test_succeeded_one_change(self):
task = Task(self.TASK_TEMPLATE)
task.result = {
'details': self._generate_details(),
'num_changes': 1
}
self.command.succeeded('', task)
tags = self.prompt.get_write_tags()
self.assertTrue(content.TAG_CHANGE_MADE in tags)
示例3: test_succeeded_no_change
# 需要导入模块: from pulp.bindings.responses import Task [as 别名]
# 或者: from pulp.bindings.responses.Task import result [as 别名]
def test_succeeded_no_change(self):
task = Task(self.TASK_TEMPLATE)
task.result = {
'details': {constants.TYPE_PUPPET_MODULE: {'details': {}}},
'num_changes': 0
}
self.command.succeeded('', task)
tags = self.prompt.get_write_tags()
self.assertTrue(content.TAG_NO_CHANGES in tags)
示例4: test_succeeded_multiple_changes
# 需要导入模块: from pulp.bindings.responses import Task [as 别名]
# 或者: from pulp.bindings.responses.Task import result [as 别名]
def test_succeeded_multiple_changes(self):
task = Task(self.TASK_TEMPLATE)
task.result = {
'details': self._generate_details(),
'num_changes': 2
}
self.command.succeeded('', task)
tags = self.prompt.get_write_tags()
self.assertTrue(content.TAG_CHANGE_MADE in tags)
# make sure it's just 1 message even though there were 2 changes
self.assertEqual(len(filter(lambda x: x==content.TAG_CHANGE_MADE, tags)), 1)