예제 #1
0
def test_group_by_ba():
    aggregat = group_by(("b", "a"), ENTRIES)
    assert len(aggregat[(200, 1)]) == 1
    assert len(aggregat[(250, 1)]) == 1
    assert len(aggregat[(200, 10)]) == 1
    assert len(aggregat[(2, 100)]) == 1
    assert len(aggregat) == 4
예제 #2
0
def test_group_by_ab():
    aggregat = group_by(("a", "b"), ENTRIES)
    assert len(aggregat[(1, 200)]) == 1
    assert len(aggregat[(1, 250)]) == 1
    assert len(aggregat[(10, 200)]) == 1
    assert len(aggregat[(100, 2)]) == 1
    assert len(aggregat) == 4
예제 #3
0
def test_group_by_c():
    aggregat = group_by("c", ENTRIES)
    assert len(aggregat[31]) == 1
    assert len(aggregat[3]) == 1
    assert len(aggregat[30]) == 1
    assert len(aggregat[300]) == 1
    assert len(aggregat) == 4
예제 #4
0
def test_group_by_b():
    aggregat = group_by("b", ENTRIES)
    assert len(aggregat[2]) == 1
    assert len(aggregat[200]) == 2
    assert len(aggregat[250]) == 1
    assert len(aggregat) == 3
예제 #5
0
def test_group_by_a():
    #for k in ["a", "b", "c", ["a", "b"], ["b", "a"]]:
    aggregat = group_by("a", ENTRIES)
    assert len(aggregat[1]) == 2
    assert len(aggregat[10]) == 1
    assert len(aggregat[100]) == 1