Пример #1
0
def test_find_cumulative_marks_i_1():
    results = [('p101111', 'Ali Khayam', 164, 75, 8.9, 125, 0),
               ('p101112', 'Mudasser Farooq', 14, 2.5, 8.3, 760),
               ('p101113', 'Tamleek Ali', 87, None, 1.6)]
    results_out = [('p101111', 'Ali Khayam', 372.9),
                   ('p101112', 'Mudasser Farooq', 784.8),
                   ('p101113', 'Tamleek Ali', 88.6)]
    assert find_cumulative_marks(results) == results_out
Пример #2
0
def test_find_cumulative_marks_s_1():
    results = [('p101111', 'Ali Khayam', 64, 78.5, 89, 25, 99),
               ('p101112', 'Mudasser Farooq', 14, 28.5, 83, 76),
               ('p101113', 'Tamleek Ali', 87, None, 1.6)]
    results_out = [('p101111', 'Ali Khayam', 355.5),
                   ('p101112', 'Mudasser Farooq', 201.5),
                   ('p101113', 'Tamleek Ali', 88.6)]
    assert find_cumulative_marks(results) == results_out
Пример #3
0
def test_find_cumulative_marks_i_4():
    results = [('p101111', 'Ali Khayam', None, None, 89, 25, 99),
               ('p101112', 'Mudasser Farooq', 14, 8.5, None, 76),
               ('p101113', 'Tamleek Ali', 87, None, 19.6),
               ('p101114', 'Jawad Mansoor', None, None, None, None)]
    results_out = [('p101111', 'Ali Khayam', 213),
                   ('p101112', 'Mudasser Farooq', 98.5),
                   ('p101113', 'Tamleek Ali', 106.6),
                   ('p101114', 'Jawad Mansoor', 0)]
    assert find_cumulative_marks(results) == results_out
Пример #4
0
def test_find_cumulative_marks_i_3():
    results = [('p101111', 'Ali Khayam', None, 12.5, 8, 25, 99),
               ('p101112', 'Mudasser Farooq', 14, 28.5, None, 76),
               ('p101113', 'Tamleek Ali', 87, None, None),
               ('p101114', 'Jawad Mansoor', 817, None, 908.6)]
    results_out = [('p101111', 'Ali Khayam', 144.5),
                   ('p101112', 'Mudasser Farooq', 118.5),
                   ('p101113', 'Tamleek Ali', 87),
                   ('p101114', 'Jawad Mansoor', 1725.6)]
    assert find_cumulative_marks(results) == results_out
Пример #5
0
def test_find_cumulative_marks_i_2():
    results = [('p101111', 'Ali Khayam', 64, 7.5, 19, 25, 99),
               ('p101112', 'Mudasser Farooq', 1.4, 28.5, 83, 76),
               ('p101113', 'Tamleek Ali', 870, None, 1.6),
               ('p101114', 'Jawad Mansoor', 8.7, 1.2, None, 98.6)]
    results_out = [('p101111', 'Ali Khayam', 214.5),
                   ('p101112', 'Mudasser Farooq', 188.9),
                   ('p101113', 'Tamleek Ali', 871.6),
                   ('p101114', 'Jawad Mansoor', 108.5)]
    assert find_cumulative_marks(results) == results_out
Пример #6
0
def test_find_cumulative_marks_s_5():
    results = [('p101111', 'Ali Khayam', None),
               ('p101112', 'Mudasser Farooq', None),
               ('p101113', 'Tamleek Ali'),
               ('p101114', 'Jawad Mansoor', None, None, None, None)]
    results_out = [('p101111', 'Ali Khayam', 0),
                   ('p101112', 'Mudasser Farooq', 0),
                   ('p101113', 'Tamleek Ali', 0),
                   ('p101114', 'Jawad Mansoor', 0)]
    assert find_cumulative_marks(results) == results_out
Пример #7
0
def test_find_cumulative_marks_s_3():
    results = [('p101111', 'Ali Khayam', None, 78.5, 89, 25, 99),
               ('p101112', 'Mudasser Farooq', 14, 18.5, None, 76),
               ('p101113', 'Tamleek Ali', 87, None, 19.6),
               ('p101114', 'Jawad Mansoor', 87, None, None, 908.6)]
    results_out = [('p101111', 'Ali Khayam', 291.5),
                   ('p101112', 'Mudasser Farooq', 108.5),
                   ('p101113', 'Tamleek Ali', 106.6),
                   ('p101114', 'Jawad Mansoor', 995.6)]
    assert find_cumulative_marks(results) == results_out
Пример #8
0
def test_find_cumulative_marks_i_6():
    results = [
        ('p101111', 'Ali Khayam'),
    ]
    results_out = [('p101111', 'Ali Khayam', 0)]
    assert find_cumulative_marks(results) == results_out
Пример #9
0
def test_find_cumulative_marks_i_5():
    results = []
    results_out = []
    assert find_cumulative_marks(results) == results_out
Пример #10
0
def test_find_cumulative_marks_i_7():
    results = None
    results_out = None
    assert find_cumulative_marks(results) == results_out