def test_get_avg_items_from_collection(self):
    c = Collection([{'foo': 10}, {'foo': 20}])
    self.assertEqual(15, c.avg('foo'))
    c = Collection([1, 2, 3, 4, 5])
    self.assertEqual(3, c.avg())
    c = Collection()
    self.assertIsNone(c.avg())
def test_get_avg_items_from_collection(self):
    c = Collection([{'foo': 10}, {'foo': 20}])
    self.assertEqual(15, c.avg('foo'))
    c = Collection([1, 2, 3, 4, 5])
    self.assertEqual(3, c.avg())
    c = Collection()
    self.assertIsNone(c.avg())