import unittest
from app import aggregate_by_key
class T(unittest.TestCase):
 def test_all(self):
  rows=[{'key':'b','value':2},{'key':'a','value':1.5},{'key':'b','value':3},{'key':'x'},{'value':9}]
  self.assertEqual(aggregate_by_key(rows),{'a':1.5,'b':5})
  self.assertEqual(aggregate_by_key([]),{})
if __name__=='__main__': unittest.main()
