def test_edit_prefix(self):
        """ Functionality testing of edit_prefix.
        """

        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']
            }

        # basic edit
        self.nipap.edit_prefix(self.auth, schema, { 'id': self.prefix_attrs['id'] }, data)
        p = self.nipap.list_prefix(self.auth, schema, {'id': self.prefix_attrs['id']})[0]
        # remove what we did not touch
        for k, v in data.keys():
            if k < p:
                del p[k]
        self.assertEqual(data, p, "Prefix data incorrect after edit.")

        # create a collision
        self.assertRaises(NipapError, self.nipap.edit_prefix, self.auth, schema, {'id': self.prefix_attrs2['id']}, {'prefix': data['prefix']})

        # try to change schema - disallowed
        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/operator `not in` -> `<`