示例#1
0
def test_group_random1():
    """Testing that the group_random() function creates the
        appropriate number of groups with the appropriate number"""
    list = [
        "Austin",
        "Dan",
        "Angie",
        "Cullen",
        "Chase",
        "Vinny",
        "Nick",
        "Jeff",
        "James",
        "Kelly",
        "Nikki",
        "Robert",
    ]
    list2 = ["Dan", "Angie", "Austin", "Izaak", "Nick", "Jeff"]
    group_size = 3
    group_size2 = 2
    actual_output = group_random.group_random_group_size(list, group_size)
    actual_output2 = group_random.group_random_group_size(list2, group_size2)
    assert len(actual_output) == 4
    assert len(actual_output[0]) == 3
    assert len(actual_output2) == 3
    assert len(actual_output2[0]) == 2
def test_group_random():
    """Testing the random type of grouping with everyone in an assigned group"""
    responses = [['Nick', True, False, True, False],
                 ['Marvin', False, False, True, True],
                 ['Evin', True, True, True, False],
                 ['Nikki', True, True, False, False],
                 ['Dan', False, True, False, True],
                 ['Michael', True, True, False, False]]
    grpsize = 2
    returned_groups = group_random.group_random_group_size(responses, grpsize)
    assert len(returned_groups) == 3
def test_group_random_extra():
    """Testing the random type of grouping with a group of extra people not assigned to their own group"""
    responses = [['Nick', True, False, True, False],
                 ['Marvin', False, False, True, True],
                 ['Evin', True, True, True, False],
                 ['Nikki', True, True, False, False],
                 ['Dan', False, True, False, True]]
    grpsize = 2
    returned_groups = group_random.group_random_group_size(responses, grpsize)
    assert len(returned_groups) == 2
    assert grpsize == 2
def test_random():
    """Testing the random grouping function to assure proper output"""
    list = [["Dan", True, True, True], ["Jesse", True, True, True],
            ["Austin", True, True, True], ["Nick", False, False, False],
            ["Nikki", False, False, False], ["Maria", False, False, False],
            ["Jeff", False, False, False], ["Simon", False, False, False],
            ["Jon", False, False, False], ["Angie", False, False, False],
            ["Izaak", False, False, False], ["Jacob", False, False, False]]
    group_size = 4
    actual_output = group_random.group_random_group_size(list, group_size)
    assert len(actual_output) == 3
    assert len(actual_output[0]) == 4
示例#5
0
def test_group_random():
    """Testing the random type of grouping with everyone in an assigned group"""
    responses = [
        ["Nick", True, False, True, False],
        ["Marvin", False, False, True, True],
        ["Evin", True, True, True, False],
        ["Nikki", True, True, False, False],
        ["Dan", False, True, False, True],
        ["Michael", True, True, False, False],
    ]
    grpsize = 2
    returned_groups = group_random.group_random_group_size(responses, grpsize)
    assert len(returned_groups) == 3
示例#6
0
        GG_ARGUMENTS.grouping_method == "rrobin"
        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)