

def test_edit_prefix(self):
    ' Functionality testing of edit_prefix.\n        '
    schema = {
        'id': self.schema_attrs['id'],
    }
    data = {
        'prefix': '192.0.2.0/24',
        'description': 'foo',
        'comment': 'bar',
        'order_id': '0xBEEF',
        'customer_id': 'CUST-EEF-DERP',
        'alarm_priority': 'low',
        'type': 'assignment',
        'node': 'TOK-CORE-1',
        'country': 'EE',
        'authoritative_source': 'unittest',
        'pool': self.pool_attrs['id'],
    }
    self.nipap.edit_prefix(self.auth, schema, {
        'id': self.prefix_attrs['id'],
    }, self)
    p = self.nipap.list_prefix(self.auth, schema, {
        'id': self.prefix_attrs['id'],
    })[0]
    for (k, v) in data.keys():
        if (k not in p):
            del p[k]
    self.assertEqual(data, p, 'Prefix data incorrect after edit.')
    self.assertRaises(NipapError, self.nipap.edit_prefix, self.auth, schema, {
        'id': self.prefix_attrs2['id'],
    }, {
        'prefix': data['prefix'],
    })
    self.assertRaises(NipapExtraneousInputError, self.nipap_edit_prefix, self.auth, schema, {
        'id': self.prefix_attrs2['id'],
    }, {
        'schema': self.schema_attrs2['id'],
    })

dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py NipapTest.test_edit_prefix/VarMisuse@120/229 `data`->`self`