本文整理汇总了Python中helper.Helper.calculate_data方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.calculate_data方法的具体用法?Python Helper.calculate_data怎么用?Python Helper.calculate_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.Helper
的用法示例。
在下文中一共展示了Helper.calculate_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_calculate_data_multiticket
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import calculate_data [as 别名]
def test_calculate_data_multiticket(self):
start = datetime.strptime('2015/10/1', '%Y/%m/%d')
end = datetime.strptime('2015/10/3', '%Y/%m/%d')
daterange = ['2015/10/01', '2015/10/02']
member = 'admin'
tickets = [
{
'reporter': 'admin',
'due_assign': '2015/10/01',
'point': '10'
},
{
'reporter': 'admin',
'due_assign': '2015/10/02',
'point': '5'
},
{
'reporter': 'admin',
'due_assign': '2015/10/03', # out of date
'point': '5'
},
{
'reporter': 'guest', # assign others
'due_assign': '2015/10/01',
'point': '8'
}]
backlog = Helper.calculate_data(tickets, member, daterange)
assert backlog == ['admin', '15', '5', '0']
示例2: test_calculate_data_empty
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import calculate_data [as 别名]
def test_calculate_data_empty(self):
start = datetime.strptime('2015/10/1', '%Y/%m/%d')
end = datetime.strptime('2015/10/3', '%Y/%m/%d')
daterange = ['2015/10/01', '2015/10/02']
member = 'admin'
tickets = []
backlog = Helper.calculate_data(tickets, member, daterange)
assert backlog == ['admin', '0', '0', '0']
示例3: test_calculate_data
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import calculate_data [as 别名]
def test_calculate_data(self):
daterange = ['2015/10/01', '2015/10/02']
member = 'admin'
tickets = [{
'reporter': 'admin',
'due_assign': '2015/10/01',
'point': '1'}]
backlog = Helper.calculate_data(tickets, member, daterange)
assert backlog == ['admin', '1', '0', '0']