def test_prefix_in_a_pool(self):
        schema = {'id': self.schema_attrs['id']}
        pool = self.nipap.list_pool(self.auth, schema, { 'id': self.pool_attrs['id'] })
        # first make sure our pool exists
        self.assertNotEqual(pool[0], [], 'Pool must exist!')
        pfxs = [
                '1.2.2.0/32',
                '1.2.2.1/32',
                '1.2.2.2/32',
                '1.2.2.3/32',
                '1.2.2.4/32',
                '1.2.2.5/32'
                ]
        for p in pfxs:
            prefix_attrs = {
                    'authoritative_source': 'nipap-test',
                    'prefix': p,
                    'type': 'host',
                    'description': 'test prefix',
                    'pool_id': self.pool_attrs['id'],
                    'comment': 'test comment, please remove! ;)'
                    }
            self.nipap.add_prefix(self.auth, schema, prefix_attrs)

        # list again
        pool = self.nipap.list_pool(self.auth, schema, { 'id': self.pool_attrs['id'] })
        self.assertNotEqual(pool[0], [], 'Pool must exist!')
        self.assertEqual(set(pfxs), set(pool[0]['prefixes']), 'Returned prefixes do not match added ones')
Add prefixes to a poll and list!
dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py/NipapTest.test_prefix_in_a_pool