本文整理汇总了Python中iso_distributor.distributor.ISODistributor.set_progress方法的典型用法代码示例。如果您正苦于以下问题:Python ISODistributor.set_progress方法的具体用法?Python ISODistributor.set_progress怎么用?Python ISODistributor.set_progress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iso_distributor.distributor.ISODistributor
的用法示例。
在下文中一共展示了ISODistributor.set_progress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_progress
# 需要导入模块: from iso_distributor.distributor import ISODistributor [as 别名]
# 或者: from iso_distributor.distributor.ISODistributor import set_progress [as 别名]
def test_set_progress(self):
"""
Test set_progress, which simply checks if the progress_callback is None before calling it
"""
# Setup
mock_callback = mock.Mock()
distributor = ISODistributor()
# Test
distributor.set_progress('id', 'status', mock_callback)
mock_callback.assert_called_once_with('id', 'status')
示例2: test_set_progress_no_callback
# 需要导入模块: from iso_distributor.distributor import ISODistributor [as 别名]
# 或者: from iso_distributor.distributor.ISODistributor import set_progress [as 别名]
def test_set_progress_no_callback(self):
"""
Assert that set_progress don't not attempt to call the callback when it is None
"""
# Setup
distributor = ISODistributor()
# Test
try:
distributor.set_progress('id', 'status', None)
except AttributeError:
self.fail('set_progress should not try to call None')