本文整理汇总了Python中pulp.plugins.util.publish_step.PluginStep.parent方法的典型用法代码示例。如果您正苦于以下问题:Python PluginStep.parent方法的具体用法?Python PluginStep.parent怎么用?Python PluginStep.parent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.plugins.util.publish_step.PluginStep
的用法示例。
在下文中一共展示了PluginStep.parent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_process_step_failure_reported_on_metadata_finalized
# 需要导入模块: from pulp.plugins.util.publish_step import PluginStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.PluginStep import parent [as 别名]
def test_process_step_failure_reported_on_metadata_finalized(self, mock_get_units):
self.pluginstep.repo.content_unit_counts = {'FOO_TYPE': 1}
mock_get_units.return_value = ['mock_unit']
step = PluginStep('foo_step')
step.parent = self.pluginstep
step.finalize = Mock(side_effect=Exception())
self.assertRaises(Exception, step.process)
self.assertEquals(step.state, reporting_constants.STATE_FAILED)
self.assertEquals(step.progress_successes, 1)
self.assertEquals(step.progress_failures, 1)
self.assertEquals(step.total_units, 1)
示例2: test_record_failure
# 需要导入模块: from pulp.plugins.util.publish_step import PluginStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.PluginStep import parent [as 别名]
def test_record_failure(self):
plugin_step = PluginStep('foo_step')
plugin_step.parent = self.pluginstep
error_msg = 'Too bad, so sad'
try:
raise Exception(error_msg)
except Exception, e:
tb = sys.exc_info()[2]
plugin_step._record_failure(e, tb)
示例3: test_report_progress
# 需要导入模块: from pulp.plugins.util.publish_step import PluginStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.PluginStep import parent [as 别名]
def test_report_progress(self):
plugin_step = PluginStep('foo_step')
plugin_step.parent = Mock()
plugin_step.report_progress()
plugin_step.parent.report_progress.assert_called_once_with(False)
示例4: test_get_conduit_from_parent
# 需要导入模块: from pulp.plugins.util.publish_step import PluginStep [as 别名]
# 或者: from pulp.plugins.util.publish_step.PluginStep import parent [as 别名]
def test_get_conduit_from_parent(self):
step = PluginStep('foo_step')
step.conduit = 'foo'
step.parent = Mock()
step.parent.get_conduit.return_value = 'foo'
self.assertEquals('foo', step.get_conduit())