'Testing MultiPoint objects.'

def test_multipoints(self):

    for mp in self.geometries.multipoints:
        mpnt = fromstr(mp.wkt)
        self.assertEqual(mpnt.geom_type, u'MultiPoint')
        self.assertEqual(mpnt.geom_typeid, 4)
        self.assertAlmostEqual(mp.centroid[0], mpnt.centroid.tuple[0], 9)
        self.assertAlmostEqual(mp.centroid[1], mpnt.centroid.tuple[1], 9)
        self.assertRaises(GEOSIndexError, mpnt.__getitem__, len(mpnt))
        self.assertEqual(mp.centroid, mpnt.centroid.tuple)
        self.assertEqual(mp.coords, tuple((m.tuple for m in mpnt)))
        for p in mpnt:
            self.assertEqual(p.geom_type, u'Point')
            self.assertEqual(p.geom_typeid, 0)
            self.assertEqual(p.empty, False)
            self.assertEqual(p.valid, True)
