def test_remove_student_from_classroom(): """ Dependencies: - create_classroom() - add_student_to_classroom() """ student_Info = { "John Smith": markbook.create_student(first_name="John", last_name="Smith", gender="Male", image="jsmith.png", student_number=111, grade=9, email="*****@*****.**") } classroom_Info = { "ICS4U": markbook.create_classroom(course_code="ICS4U", course_name="Computer Science", period=2, teacher="Mr. Gallo") } markbook.add_student_to_classroom(student_Info["John Smith"], classroom_Info["ICS4U"]) assert len(classroom_Info["ICS4U"]["student_list"]) == 1 markbook.remove_student_from_classroom(student_Info["John Smith"], classroom_Info["ICS4U"]) assert type(classroom_Info["ICS4U"]["student_list"]) is list assert len(classroom_Info["ICS4U"]["student_list"]) == 0 assert len(student_Info["John Smith"]["classes"]) == 0
def test_remove_student_from_classroom(): """ Dependencies: - create_classroom() - add_student_to_classroom() """ classroom = markbook.create_classroom(course_code="ICS4U", course_name="Computer Science", period=2, teacher="Mr. Gallo") student = {"first_name": "John", "last_name": "Smith"} markbook.add_student_to_classroom(student, classroom) assert len(classroom["student_list"]) == 1 markbook.remove_student_from_classroom(student, classroom) assert type(classroom["student_list"]) is list assert len(classroom["student_list"]) == 0
def test_remove_student_from_classroom(): """ Dependencies: - create_classroom() - add_student_to_classroom() """ classroom = markbook.create_classroom(course_code="ICS4U", course_name="Computer Science", period=2, teacher="Mr. Gallo") first_name = "test" last_name = "test" markbook.add_student_to_classroom(first_name, last_name) assert len(classroom["Students"]) == 1 markbook.remove_student_from_classroom(first_name, last_name) assert type(classroom["Students"]) is list assert len(classroom["Students"]) == 0
break # getting student student = student_search(classroom) print(student) print('0 = False, 1 = True') # confriming student confirm = int( input('Are you sure that you want to remove ' + student.get('first_name') + ' ' + student.get('last_name') + ' from ' + classroom.get('course_name'))) # removing student if confirm == 1: remove_student_from_classroom(student, classroom) overwrite(copy) break else: break elif page == 6: # edit a student WIP clear_screen() print('---EDIT A STUDENT (WIP)---') copy = copy() classroom = class_search(copy) if classroom is None: break student = student_search(classroom)