Ejemplo n.º 1
0
def get_speed_str(event_id):
    speed = mltd_api.calculate_speed(event_id, 'hour')
    return_str = ''
    if speed:
        for key in speed:
            return_str += '{}名 時速:{}\n'.format(key, speed[key])
    else:
        return_str = '這個活動不是排名活動'
    return return_str
Ejemplo n.º 2
0
def test_calculate_speed_4():
    speed_dict = mltd_api.calculate_speed('1', 'min')
    assert speed_dict['2500'] == 40
    assert speed_dict['5000'] == 20
    assert speed_dict['10000'] == 10
Ejemplo n.º 3
0
def test_calculate_speed_3():
    speed_dict = mltd_api.calculate_speed('1', 'quarter_hour')
    assert speed_dict['2500'] == 600
    assert speed_dict['5000'] == 300
    assert speed_dict['10000'] == 150
Ejemplo n.º 4
0
def test_calculate_speed_2():
    speed_dict = mltd_api.calculate_speed('1', 'half_hour')
    assert speed_dict['2500'] == 1200
    assert speed_dict['5000'] == 600
    assert speed_dict['10000'] == 300