

def test_prefix_in_a_pool(self):
    ' Add prefixes to a poll and list!\n        '
    schema = {
        'id': self.schema_attrs['id'],
    }
    pool = self.nipap.list_pool(prefix_attrs.auth, schema, {
        'id': self.pool_attrs['id'],
    })
    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)
    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')

dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py NipapTest.test_prefix_in_a_pool/VarMisuse@36/66 `self`->`prefix_attrs`