

def setUp(self):
    ' Better start from a clean slate!\n        '
    cfg = NipapConfig('/etc/nipap/nipap.conf')
    self.nipap = Nipap()
    self.auth = SqliteAuth('local', 'unittest', 'unittest', 'unittest')
    self.auth.authenticated_as = 'unittest'
    self.auth.full_name = 'Unit test'
    self.nipap._execute('TRUNCATE ip_net_plan, ip_net_pool, ip_net_vrf, ip_net_log, ip_net_asn')
    self.schema_attrs = {
        'name': 'test-schema1',
        'description': 'Test schema numero uno!',
    }
    self.schema_attrs['id'] = self.nipap.add_schema(self.auth, self.schema_attrs)
    self.schema_attrs2 = {
        'name': 'test-schema2',
        'description': 'Test schema numero dos!',
    }
    self.schema_attrs2['id'] = self.nipap.add_schema(self.auth, self.schema_attrs2)
    self.pool_attrs = {
        'name': 'test-pool1',
        'description': 'Test pool numero uno!',
        'default_type': 'assignment',
        'ipv4_default_prefix_length': 30,
        'ipv6_default_prefix_length': 112,
    }
    self.pool_attrs['id'] = self.nipap.add_pool(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.pool_attrs)
    self.prefix_attrs1 = {
        'authoritative_source': 'nipaptest',
        'prefix': '1.3.3.0/24',
        'type': 'assignment',
        'description': '',
    }
    self.prefix_attrs1['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix_attrs1)
    self.prefix_attrs = {
        'authoritative_source': 'nipaptest',
        'prefix': '1.3.3.1/32',
        'type': 'host',
        'description': 'Test prefix numero uno!',
    }
    self.prefix_attrs['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix_attrs)
    self.prefix_attrs2 = {
        'authoritative_source': 'nipaptest',
        'prefix': '1.3.2.0/23',
        'type': 'reservation',
        'description': '',
    }
    self.prefix_attrs2['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix_attrs2)
    self.prefix_attrs3 = {
        'authoritative_source': 'nipaptest',
        'prefix': '1.3.0.0/16',
        'type': 'reservation',
        'description': '',
    }
    self.prefix_attrs3['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix_attrs3)
    self.prefix_attrs4 = {
        'authoritative_source': 'nipaptest',
        'prefix': '1.3.0.0/17',
        'type': 'reservation',
        'description': '',
    }
    self.prefix_attrs4['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs2['id'],
    }, self.prefix_attrs4)
    self.prefix6_attrs1 = {
        'authoritative_source': 'nipaptest',
        'prefix': '2001:0db8:3:3::/112',
        'type': 'assignment',
        'description': '',
    }
    self.prefix6_attrs1['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix6_attrs1)
    self.prefix6_attrs = {
        'authoritative_source': 'nipaptest',
        'prefix': '2001:0db8:3:3::1/128',
        'type': 'host',
        'description': 'Test prefix numero uno!',
    }
    self.prefix6_attrs['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix6_attrs)
    self.prefix6_attrs2 = {
        'authoritative_source': 'nipaptest',
        'prefix': '2001:0db8:3:3::/64',
        'type': 'reservation',
        'description': '',
    }
    self.prefix6_attrs2['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix6_attrs2)
    self.prefix6_attrs3 = {
        'authoritative_source': 'nipaptest',
        'prefix': '2001:0db8:3:0::/48',
        'type': 'reservation',
        'description': '',
    }
    self.prefix6_attrs3['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs['id'],
    }, self.prefix6_attrs3)
    self.prefix6_attrs4 = {
        'authoritative_source': 'nipaptest',
        'prefix': '2001:0db8:3:0::/56',
        'type': 'reservation',
        'description': '',
    }
    self.prefix6_attrs4['id'] = self.nipap.add_prefix(self.auth, {
        'id': self.schema_attrs2['id'],
    }, cfg.prefix6_attrs4)

dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py NipapTest.setUp/VarMisuse@851/1529 `self`->`cfg`