#NEWLINE# def test_points( self ) : #NEWLINE# #INDENT# 'Testing Point objects.' #NEWLINE# prev = fromstr ( 'POINT(0 0)' ) #NEWLINE# for p in self . geometries . points : #NEWLINE# #INDENT# pnt = fromstr ( p . wkt ) #NEWLINE# self . assertEqual ( pnt . geom_type , 'Point' ) #NEWLINE# self . assertEqual ( pnt . geom_typeid , 0 ) #NEWLINE# self . assertEqual ( p . x , pnt . x ) #NEWLINE# self . assertEqual ( p . y , pnt . y ) #NEWLINE# self . assertEqual ( True , ( pnt == fromstr ( p . wkt ) ) ) #NEWLINE# self . assertEqual ( False , ( pnt == prev ) ) #NEWLINE# self . assertAlmostEqual ( p . x , pnt . tuple [ 0 ] , 9 ) #NEWLINE# self . assertAlmostEqual ( p . y , pnt . tuple [ 1 ] , 9 ) #NEWLINE# if hasattr ( p , 'z' ) : #NEWLINE# #INDENT# self . assertEqual ( True , pnt . hasz ) #NEWLINE# self . assertEqual ( p . z , pnt . z ) #NEWLINE# self . assertEqual ( p . z , pnt . tuple [ 2 ] , 9 ) #NEWLINE# tup_args = ( p . x , p . y , p . z ) #NEWLINE# set_tup1 = ( 2.71 , 3.14 , 5.23 ) #NEWLINE# set_tup2 = ( 5.23 , 2.71 , 3.14 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( False , pnt . hasz ) #NEWLINE# self . assertEqual ( None , pnt . z ) #NEWLINE# tup_args = ( p . x , p . y ) #NEWLINE# set_tup1 = ( 2.71 , 3.14 ) #NEWLINE# set_tup2 = ( 3.14 , 2.71 ) #NEWLINE# #UNINDENT# self . assertEqual ( p . centroid , pnt . centroid . tuple ) #NEWLINE# pnt2 = Point ( tup_args ) #NEWLINE# pnt3 = Point ( * tup_args ) #NEWLINE# self . assertEqual ( True , ( pnt == pnt2 ) ) #NEWLINE# self . assertEqual ( True , ( pnt == pnt3 ) ) #NEWLINE# pnt . y = 3.14 #NEWLINE# pnt . x = 2.71 #NEWLINE# self . assertEqual ( 3.14 , pnt . y ) #NEWLINE# self . assertEqual ( 2.71 , pnt . x ) #NEWLINE# pnt . tuple = set_tup1 #NEWLINE# self . assertEqual ( set_tup1 , pnt . tuple ) #NEWLINE# pnt . coords = set_tup2 #NEWLINE# self . assertEqual ( set_tup2 , pnt . coords ) #NEWLINE# prev = pnt