def _compare_tasks(self, reference, result):
        reference.sort(key=lambda x: x.get('id', x.get('task_name')))
        result.sort(key=lambda x: x.get('id', x.get('task_name')))
        self.assertEqual(len(reference), len(result))
        for ref, res in six.moves.zip(reference, result):
            for field in ref:
                if field == '_custom':
                    # unpack custom json fields if persist
                    self.assertEqual(
                        jsonutils.loads(ref.get(field)),
                        jsonutils.loads((res or {}).get(field))
                    )
                else:
                    self.assertEqual(ref.get(field), (res or {}).get(field))


# this method is for development and troubleshooting purposes
harvey helps you manage and add license from the command line
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py/DeploymentTasksTestMixin._compare_tasks--crossover with--dataset/ETHPy150Open architv/harvey/harvey/harvey.py/main