def test_prefix_indent_ipv4(self):
        schema = {'id': self.schema_attrs['id']}
        p1 = self.nipap.list_prefix(self.auth, schema, { 'prefix': '1.3.3.1/32' })[0]
        p2 = self.nipap.list_prefix(self.auth, schema, { 'prefix': '1.3.3.0/24' })[0]
        p3 = self.nipap.list_prefix(self.auth, schema, { 'prefix': '1.3.0.0/16' })[0]
        self.assertEqual(p1['indent'], 4, "Indent calc on add failed")
        self.assertEqual(p2['indent'], 3, "Indent calc on add failed")
        self.assertEqual(p3['indent'], 0, "Indent calc on add failed")
        # remove middle prefix
        self.nipap.remove_prefix(self.auth, schema, { 'id': self.prefix_attrs2['id'] })
        # check that child prefix indent level has decreased
        p1 = self.nipap.list_prefix(self.auth, schema, { 'prefix': '1.3.3.1/32' })[0]
        p3 = self.nipap.list_prefix(self.auth, schema, { 'prefix': '1.3.0.0/16' })[0]
        self.assertEqual(p1['indent'], 3, "Indent calc on remove failed")
        self.assertEqual(p3['indent'], 0, "Indent calc on remove failed")
Check that our indentation calculation is working for IPv4
dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py/NipapTest.test_prefix_indent_ipv4