def test_students_study_loop_night_day(): # Test 11 """Loop all values when time changes.""" for i in range(1, 18): if i < 5: assert solution.students_study(i, True) is False else: assert solution.students_study(i, True) is True
def test_students_study_loop_day_evening(): # Test 8 """Loop all values when time changes.""" for i in range(5, 25): if i < 18: assert solution.students_study(i, False) is False else: assert solution.students_study(i, False) is True
def test_students_study_loop_evening_night(): # Test 7 """Loop all values when time changes.""" for i in range(18, 30): if (i % 25) != 0: if (i % 25) < 5: assert solution.students_study(i % 25, True) is False else: assert solution.students_study(i % 25, True) is True
def test_students_study_false(): """ Test coffee. :return: """ assert students_study(0, True) is False assert students_study(25, False) is False
def test_students_study_5_18(): """ Test coffee. :return: """ for num in range(5, 18): assert students_study(num, False) is False assert students_study(num, True) is True
def test_students_study_18_25(): """ Test coffee. :return: """ for num in range(18, 25): assert students_study(num, False) is True assert students_study(num, True) is True
def test_students_study_1_5(): """ Test coffee. :return: """ for num in range(1, 5): assert students_study(num, False) is False assert students_study(num, True) is False
def test_students_study_morning(): """Test when morning in students_study.""" for i in range(5, 18): time = i assert solution.students_study(time, True) is True assert solution.students_study(time, False) is False
def test_students_study_night_with_coffee(): # Test 1 """Coffee is not needed at night.""" assert solution.students_study(1, True) is False
def test_coffee_3(): """Should return False, since its daytime, but coffee is False.""" for i in range(5, 18): assert students_study(i, False) is False
def test_students_study_24(): """Test if students study at 24 am.""" assert solution.students_study(24, True) is True assert solution.students_study(24, False) is True
def test_students_study_17(): """Test if students study at 17 pm.""" assert solution.students_study(17, True) is True assert solution.students_study(17, False) is False
def test_students_study_4(): """Test if students study at 4 am.""" assert solution.students_study(4, False) is False assert solution.students_study(4, True) is False
def test_coffee_4(): """Should return True, since its daytime and coffee is True.""" for i in range(5, 18): assert students_study(i, True) is True
def test_students_study_loop_coffee_important(): # Test 9 """Loop all values when coffee important.""" for i in range(1, 25): assert solution.students_study(i, True) is False if i < 5 else True
def test_coffee_1(): """Should return True on all occasions.""" for i in range(18, 25): assert students_study(i, True) is True
def test_coffee_6(): """Should return False on all occasions.""" for i in range(1, 5): assert students_study(i, False) is False
def test_students_study_loop_coffee_not_important(): # Test 10 & 12 """Loop all values when coffee not important.""" for i in range(1, 25): assert solution.students_study(i, False) is False if i < 18 else True
def test_students_study_night(): """Test when night in students_study.""" for i in range(1, 5): time = i assert solution.students_study(time, True) is False assert solution.students_study(time, False) is False
def test_students_study_night_wo_coffee(): # Test 2 """Coffee is not needed at night.""" assert solution.students_study(4, False) is False
def test_students_study_evening(): """Test when evening in students_study.""" for i in range(18, 25): time = i assert solution.students_study(time, True) is True assert solution.students_study(time, False) is True
def test_students_study_18(): """Test if students study at 18 pm.""" assert solution.students_study(18, True) is True assert solution.students_study(18, False) is True
def test_students_study_daytime_with_coffee(): # Test 3 """Coffee is needed on daytime.""" assert solution.students_study(5, True) is True
def test_students_study_5(): """Test if students study at 5 am.""" assert solution.students_study(5, True) is True assert solution.students_study(5, False) is False
def test_students_study_daytime_wo_coffee(): # Test 4 """Coffee is needed on daytime.""" assert solution.students_study(17, False) is False
def test_students_study_1(): """Test if students study at 1 am.""" assert solution.students_study(1, False) is False assert solution.students_study(1, True) is False
def test_students_study_coffee_not_important(): # Test 5 & 6 """Coffee is not important.""" assert solution.students_study(19, True) == solution.students_study(19, False)