first I started my project for the teacher iwas confused i emaild him about it (thx mrw) he told me its like JSON and next day in school i learnd from him more (thx mrw)
def test_check_grade_level():
assert check_grade_level({'grade': 9}) == 'freshman'
assert check_grade_level({'grade': 10}) == 'sophomore'
assert check_grade_level({'grade': 11}) == 'junior'
assert check_grade_level({'grade': 12}) == 'senior'
assert check_grade_level({'grade': 8}) == 'Invalid'
The function test_check_grade_level is a unit test that verifies the check_grade_level function returns the correct grade level names for given grade values. It uses assertions to check if:
Grade 9 returns ‘freshman’
Grade 10 returns ‘sophomore’
Grade 11 returns ‘junior’
Grade 12 returns ‘senior’
Any other grade (e.g., 8) returns ‘Invalid’
If any assertion fails, the test will fail, indicating an issue with the check_grade_level function.