本文整理汇总了Python中vcs.utils.progressbar.ProgressBar.get_context方法的典型用法代码示例。如果您正苦于以下问题:Python ProgressBar.get_context方法的具体用法?Python ProgressBar.get_context怎么用?Python ProgressBar.get_context使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vcs.utils.progressbar.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.get_context方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_context
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def test_context(self):
bar = ProgressBar()
context = bar.get_context()
self.assertItemsEqual(context, [
'bar',
'percentage',
'time',
'eta',
'steps',
'speed',
'transfer',
])
示例2: context_has_correct_speed
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def context_has_correct_speed(self):
bar = ProgressBar(100)
speed = bar.get_context()['speed']
self.assertEquals(speed, bar.get_rendered_speed())
示例3: test_context_has_correct_steps
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def test_context_has_correct_steps(self):
bar = ProgressBar(100)
steps = bar.get_context()['steps']
self.assertEquals(steps, bar.get_rendered_steps())
示例4: test_context_has_correct_eta
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def test_context_has_correct_eta(self):
bar = ProgressBar(100)
eta = bar.get_context()['eta']
self.assertEquals(eta, bar.get_rendered_eta())
示例5: test_context_has_correct_total_time
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def test_context_has_correct_total_time(self):
bar = ProgressBar(100)
time = bar.get_context()['time']
self.assertEquals(time, bar.get_rendered_total_time())
示例6: test_context_has_correct_percentage
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def test_context_has_correct_percentage(self):
bar = ProgressBar(100)
bar.step = 50
percentage = bar.get_context()['percentage']
self.assertEquals(percentage, bar.get_rendered_percentage())
示例7: test_context_has_correct_bar
# 需要导入模块: from vcs.utils.progressbar import ProgressBar [as 别名]
# 或者: from vcs.utils.progressbar.ProgressBar import get_context [as 别名]
def test_context_has_correct_bar(self):
bar = ProgressBar()
context = bar.get_context()
self.assertEquals(context['bar'], bar.get_bar())