示例#1
0
def test_full_new_class():
    """Returns empty NewClass instantiated with students."""
    test_full_new_class = NewClass(
        test_full_class_data_set['json_dict_rep']['name'])
    for student in test_full_class_data_set['json_dict_rep']['students']:
        test_full_new_class.add_student(Student(**student))

    test_full_new_class.json_str_rep = test_full_class_data_set['json_str_rep']
    test_full_new_class.json_dict_rep = test_full_class_data_set[
        'json_dict_rep']

    return test_full_new_class
示例#2
0
def take_class_data_input(class_name: str) -> NewClass:
    """
    Take student names, avatars, return Class object.

    :param class_name: str
    :return: Class
    """
    new_class = NewClass(name=class_name)
    while True:
        student_name = take_student_name_input(new_class)
        if student_name.upper() == 'END':
            break
        avatar_filename = take_student_avatar(new_class, student_name)
        new_class.add_student(name=student_name, avatar_id=avatar_filename)
    return new_class