Ejemplo n.º 1
0
def test_display_student_groups(capsys):
    """Checking the display of the student_groups"""
    student_groups = [['gkapfham3', 'gkapfham0'], ['gkapfham1', 'gkapfham4'],
                      ['gkapfham5', 'gkapfham7', 'gkapfham6']]
    display.display_student_groups(student_groups)
    out, err = capsys.readouterr()
    assert out.startswith('\033[0;32m' + '\033[1m' + '\033[4m' + "Group 1")
Ejemplo n.º 2
0
def test_display_student_groups(capsys):
    """Checking the display of the student_groups"""
    student_groups = [
        ["gkapfham3", "gkapfham0"],
        ["gkapfham1", "gkapfham4"],
        ["gkapfham5", "gkapfham7", "gkapfham6"],
    ]
    display.display_student_groups(student_groups)
    out, err = capsys.readouterr()
    assert out.startswith("\033[0;32m" + "\033[1m" + "\033[4m" + "Group 1")
Ejemplo n.º 3
0
        and GG_ARGUMENTS.num_group is defaults.DEFAULT_NUMGRP
    ):
        GROUPED_STUDENT_IDENTIFIERS = group_rrobin.group_rrobin_group_size(
            SHUFFLED_STUDENT_IDENTIFIERS, GG_ARGUMENTS.group_size
        )
    elif (
        GG_ARGUMENTS.grouping_method == "rrobin"
        and GG_ARGUMENTS.num_group is not defaults.DEFAULT_NUMGRP
    ):
        GROUPED_STUDENT_IDENTIFIERS = group_rrobin.group_rrobin_num_group(
            SHUFFLED_STUDENT_IDENTIFIERS, GG_ARGUMENTS.num_group
        )
    elif GG_ARGUMENTS.num_group is defaults.DEFAULT_NUMGRP:  # default to random method
        GROUPED_STUDENT_IDENTIFIERS = group_random.group_random_group_size(
            SHUFFLED_STUDENT_IDENTIFIERS, GG_ARGUMENTS.group_size
        )
    else:
        GROUPED_STUDENT_IDENTIFIERS = group_random.group_random_num_group(
            SHUFFLED_STUDENT_IDENTIFIERS, GG_ARGUMENTS.num_group
        )

    # report grouping results
    COUNT_GROUPS = len(GROUPED_STUDENT_IDENTIFIERS)
    COUNT_STUDENTS = len(SHUFFLED_STUDENT_IDENTIFIERS)
    logging.info(
        "Successfully placed %d students into %d groups ", COUNT_STUDENTS, COUNT_GROUPS
    )

    # report generated groups
    display.display_student_groups(GROUPED_STUDENT_IDENTIFIERS)