'Testing LineString objects.'

def test04_linestring(self):

    prev = OGRGeometry('POINT(0    0)')
    for ls in self.geometries.linestrings:
        linestr = OGRGeometry(ls.wkt)
        self.assertEqual(2, linestr.geom_type)
        self.assertEqual('LINESTRING', linestr.geom_name)
        self.assertEqual(ls.n_p, linestr.point_count)
        self.assertEqual(ls.coords, linestr.tuple)
        self.assertEqual(True, (linestr == OGRGeometry(ls.wkt)))
        self.assertEqual(True, (linestr != prev))
        self.assertRaises(OGRIndexError, linestr.__getitem__, len(linestr))
        prev = linestr
        x = [tmpx for (tmpx, tmpy) in ls.coords]
        y = [tmpy for (tmpx, tmpy) in ls.coords]
        self.assertEqual(x, linestr.x)
        self.assertEqual(y, linestr.y)
