def test_find_free_prefix1(self):
        schema = { 'id': self.schema_attrs['id'] }
        # set up a prefix not used elsewhere so we have a known good state
        prefix_attrs = {
                'authoritative_source': 'nipap-test',
                'prefix': '100.0.0.0/16',
                'type': 'assignment',
                'description': 'test prefix',
                'comment': 'test comment, please remove! ;)'
                }
        self.nipap.add_prefix(self.auth, schema, prefix_attrs)

        # simple test
        res = self.nipap.find_free_prefix(self.auth, schema, { 'from-prefix': [ '100.0.0.0/16', '1.3.3.0/24' ], 'prefix_length': 24, 'count': 1 })
        self.assertEqual(res, ['100.0.0.0/24'], "Incorrect prefix set returned")

        # simple test - only one input prefix (which did cause a bug, thus keeping it)
        res = self.nipap.find_free_prefix(self.auth, schema, { 'from-prefix': [ '100.0.0.0/16' ], 'prefix_length': 24, 'count': 1 })
        self.assertEqual(res, ['100.0.0.0/24'], "Incorrect prefix set returned")

        res = self.nipap.find_free_prefix(self.auth, schema, { 'from-prefix': [ '100.0.0.0/16', '1.3.3.0/24' ], 'prefix_length': 24, 'count': 999 })
        self.assertEqual(len(res), 256, "Incorrect prefix set returned")
Unique identifier of the resource.
dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py/NipapTest.test_find_free_prefix1--crossover with--dataset/ETHPy150Open s3rvac/retdec-python/retdec/resource.py/Resource.id