本文整理汇总了Python中txclib.project.Project._extract_completed方法的典型用法代码示例。如果您正苦于以下问题:Python Project._extract_completed方法的具体用法?Python Project._extract_completed怎么用?Python Project._extract_completed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类txclib.project.Project
的用法示例。
在下文中一共展示了Project._extract_completed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_extract_fields
# 需要导入模块: from txclib.project import Project [as 别名]
# 或者: from txclib.project.Project import _extract_completed [as 别名]
def test_extract_fields(self):
"""Test the functions that extract a field from a stats object."""
stats = {
'completed': '80%',
'last_update': '00:00',
'foo': 'bar',
}
self.assertEqual(
stats['completed'], '%s%%' % Project._extract_completed(stats)
)
self.assertEqual(stats['last_update'], Project._extract_updated(stats))
示例2: test_field_used_per_mode
# 需要导入模块: from txclib.project import Project [as 别名]
# 或者: from txclib.project.Project import _extract_completed [as 别名]
def test_field_used_per_mode(self):
"""Test the fields used for each mode."""
Project._extract_completed(self.stats, 'translate')
self.stats.__getitem__.assert_called_with('completed')
Project._extract_completed(self.stats, 'reviewed')
self.stats.__getitem__.assert_called_with('reviewed_percentage')
示例3: test_extract_fields
# 需要导入模块: from txclib.project import Project [as 别名]
# 或者: from txclib.project.Project import _extract_completed [as 别名]
def test_extract_fields(self):
"""Test the functions that extract a field from a stats object."""
stats = {"completed": "80%", "last_update": "00:00", "foo": "bar"}
self.assertEqual(stats["completed"], "%s%%" % Project._extract_completed(stats))
self.assertEqual(stats["last_update"], Project._extract_updated(stats))