Пример #1
0
    def test_delete_id(self):
        ix = GeoIndex('./test_indices', 'test_delete_id', int, int)

        ix.insert(1L, poly1)
        ix.insert(2L, poly2)
        ix.insert(3L, poly3)

        ix.delete(1)


        x = ix.within(cover)
        x = list(x)
        self.assertEqual(len(x), 2, "didn't drop one like we should have")
        self.assertEqual(sorted(x), [2,3], "Didn't pull back all ids")

        ix.bulk_delete([2,3])
        x = ix.within(cover)
        x = list(x)
        self.assertEqual(len(x) ,0)

        ix.drop()