def check_metrics(self, example_script, expect):
        self.b_mgr.metrics = metrics.Metrics()
        self.b_mgr.scores = []
        self.run_example(example_script)

        # test general metrics (excludes issue counts)
        m = self.b_mgr.metrics.data
        for k in expect:
            if k != 'issues':
                self.assertEqual(expect[k], m['_totals'][k])
        # test issue counts
        if 'issues' in expect:
            for (criteria, default) in C.CRITERIA:
                for rank in C.RANKING:
                    label = '{0}.{1}'.format(criteria, rank)
                    expected = 0
                    if expect['issues'].get(criteria, None).get(rank, None):
                        expected = expect['issues'][criteria][rank]
                    self.assertEqual(expected, m['_totals'][label])
Create a pool according to `attr`.
dataset/ETHPy150Open openstack/bandit/tests/functional/test_functional.py/FunctionalTests.check_metrics--crossover with--dataset/ETHPy150Open SpriteLink/NIPAP/nipap/nipap/backend.py/Nipap.add_pool