

def test_prefix_basic(self):
    ' Test basic prefix functions\n        '
    schema = {
        'id': self.schema_attrs['id'],
    }
    prefix_attrs = {
        'authoritative_source': 'nipap-test',
        'prefix': '1.3.3.7/32',
        'type': 'host',
        'description': 'test prefix',
        'comment': 'test comment, please remove! ;)',
    }
    self.nipap.add_prefix(self.auth, schema, prefix_attrs)
    prefix = self.nipap.list_prefix(self.auth, schema, {
        'prefix': prefix_attrs['prefix'],
    })
    for a in prefix_attrs:
        self.assertEqual(prefix[0][a], prefix_attrs[a], ('Added object differ from listed on attribute: ' + a))
    prefix = self.nipap.list_prefix(self.auth, schema, {
        
    })
    self.assertNotEqual(len(prefix), 0, ('Found 0 prefixes in schema ' + self.schema_attrs['name']))

dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py NipapTest.test_prefix_basic/original