コード例 #1
0
def test_should_evaluation_not_greater_than_100():
    evaluation = Evaluation()
    with pytest.raises(ValueError):
        evaluation.add_grade(101)
コード例 #2
0
from evaluation import Evaluation

if __name__ == '__main__':
    students = int(input('Students\' number:'))
    for number in range(0, students):
        evaluation = Evaluation()
        value_inputed = input('Put the grade:')
        evaluation.add_grade(int(value_inputed))
        print(f'The grade: {evaluation.grade}')
        print(f'The result: {evaluation.result}')
コード例 #3
0
def test_should_38_evaluation_not_have_to_be_40_and_must_fail():
    evaluation = Evaluation()
    evaluation.add_grade(38)
    assert evaluation.grade == 38 and evaluation.result is False
コード例 #4
0
def test_should_81_evaluation_not_have_to_be_85():
    evaluation = Evaluation()
    evaluation.add_grade(81)
    assert evaluation.grade == 81
コード例 #5
0
def test_should_84_evaluation_have_to_be_85():
    evaluation = Evaluation()
    evaluation.add_grade(84)
    assert evaluation.grade == 85
コード例 #6
0
def test_should_evaluation_less_than_40_must_fail():
    evaluation = Evaluation()
    evaluation.add_grade(30)
    assert evaluation.result is False
コード例 #7
0
def test_should_evaluation_not_less_than_0():
    evaluation = Evaluation()
    with pytest.raises(ValueError):
        evaluation.add_grade(-42)