def test_collector_aggregation(self):
        collector = WatcherStatsCollector(self._get_streamer(), 'firefox')
        aggregate = {}
        for i in range(0, 10):
            pid = 1000 + i
            aggregate[pid] = {
                'age': 154058.91111397743, 'children': [],
                'cmdline': 'python', 'cpu': 0.0 + i / 10.,
                'create_time': 1378663281.96,
                'ctime': '0:00.0', 'mem': 0.0 + i // 10,
                'mem_info1': '52K', 'mem_info2': '39M',
                'username': 'alexis', 'subtopic': pid, 'name': 'firefox'}

        res = collector._aggregate(aggregate)
        self.assertEqual(res['mem'], 0)
        self.assertEqual(len(res['pid']), 10)
        self.assertEqual(res['cpu'], 0.45)
dataset/ETHPy150Open circus-tent/circus/circus/tests/test_stats_collector.py/TestCollector.test_collector_aggregation/original