def _mangle_pool_result(self, res):

        if isinstance(res, list):
            # res from list_pool
            for p in res:
                self.assertIn('total_addresses_v4', p)
                self.assertIn('total_addresses_v6', p)
                self.assertIn('used_addresses_v4', p)
                self.assertIn('used_addresses_v6', p)
                self.assertIn('free_addresses_v4', p)
                self.assertIn('free_addresses_v6', p)
                self.assertIn('member_prefixes_v4', p)
                self.assertIn('member_prefixes_v6', p)
                self.assertIn('used_prefixes_v4', p)
                self.assertIn('used_prefixes_v6', p)
                self.assertIn('free_prefixes_v4', p)
                self.assertIn('free_prefixes_v6', p)
                self.assertIn('total_prefixes_v4', p)
                self.assertIn('total_prefixes_v6', p)
                del(p['total_addresses_v4'])
                del(p['total_addresses_v6'])
                del(p['used_addresses_v4'])
                del(p['used_addresses_v6'])
                del(p['free_addresses_v4'])
                del(p['free_addresses_v6'])
                del(p['member_prefixes_v4'])
                del(p['member_prefixes_v6'])
                del(p['used_prefixes_v4'])
                del(p['used_prefixes_v6'])
                del(p['free_prefixes_v4'])
                del(p['free_prefixes_v6'])
                del(p['total_prefixes_v4'])
                del(p['total_prefixes_v6'])

        elif isinstance(res, dict) and 'result' in res:
            # res from smart search
            for p in res['result']:
                self.assertIn('total_addresses_v4', p)
                self.assertIn('total_addresses_v6', p)
                self.assertIn('used_addresses_v4', p)
                self.assertIn('used_addresses_v6', p)
                self.assertIn('free_addresses_v4', p)
                self.assertIn('free_addresses_v6', p)
                self.assertIn('member_prefixes_v4', p)
                self.assertIn('member_prefixes_v6', p)
                self.assertIn('used_prefixes_v4', p)
                self.assertIn('used_prefixes_v6', p)
                self.assertIn('free_prefixes_v4', p)
                self.assertIn('free_prefixes_v6', p)
                self.assertIn('total_prefixes_v4', p)
                self.assertIn('total_prefixes_v6', p)
                del(p['total_addresses_v4'])
                del(p['total_addresses_v6'])
                del(p['used_addresses_v4'])
                del(p['used_addresses_v6'])
                del(p['free_addresses_v4'])
                del(p['free_addresses_v6'])
                del(p['member_prefixes_v4'])
                del(p['member_prefixes_v6'])
                del(p['used_prefixes_v4'])
                del(p['used_prefixes_v6'])
                del(p['free_prefixes_v4'])
                del(p['free_prefixes_v6'])
                del(p['total_prefixes_v4'])
                del(p['total_prefixes_v6'])

        elif isinstance(res, dict):
            # just one single pool
            self.assertIn('total_addresses_v4', res)
            self.assertIn('total_addresses_v6', res)
            self.assertIn('used_addresses_v4', res)
            self.assertIn('used_addresses_v6', res)
            self.assertIn('free_addresses_v4', res)
            self.assertIn('free_addresses_v6', res)
            self.assertIn('member_prefixes_v4', res)
            self.assertIn('member_prefixes_v6', res)
            self.assertIn('used_prefixes_v4', res)
            self.assertIn('used_prefixes_v6', res)
            self.assertIn('free_prefixes_v4', res)
            self.assertIn('free_prefixes_v6', res)
            self.assertIn('total_prefixes_v4', res)
            self.assertIn('total_prefixes_v6', res)
            del(res['total_addresses_v4'])
            del(res['total_addresses_v6'])
            del(res['used_addresses_v4'])
            del(res['used_addresses_v6'])
            del(res['free_addresses_v4'])
            del(res['free_addresses_v6'])
            del(res['member_prefixes_v4'])
            del(res['member_prefixes_v6'])
            del(res['used_prefixes_v4'])
            del(res['used_prefixes_v6'])
            del(res['free_prefixes_v4'])
            del(res['free_prefixes_v6'])
            del(res['total_prefixes_v4'])
            del(res['total_prefixes_v6'])

        return res
Mangle pool result for easier testing
dataset/ETHPy150Open SpriteLink/NIPAP/tests/xmlrpc.py/NipapXmlTest._mangle_pool_result