

def test_make_aggregate_sum():
    '\n    test_make_aggregate_sum()\n\n    Straight test that summation works over the field specified in\n    aggregate_count(keyname).\n    '
    from nose.tools import assert_equal
    doc1 = {
        'a': 2,
        'b': 2,
        'c': 2,
        'visits': 201,
    }
    doc2 = {
        'a': 2,
        'b': 2,
        'c': 2,
        'visits': 103,
    }
    docs = [doc1, doc2]
    aggregate_doc = make_aggregate(docs, [aggregate_count('visits')])
    expected_aggregate = {
        'a': 2,
        'b': 2,
        'c': 2,
        'visits': 304,
    }
    assert_equal(aggregate_doc, expected_aggregate)

dataset/ETHPy150Open alphagov/performanceplatform-collector/tests/performanceplatform/collector/ga/plugins/test_aggregate.py test_make_aggregate_sum/original