<s> from . import unittest <EOL> from shapely . geometry import Point , MultiPoint , Polygon , LineString <EOL> class OperatorsTestCase ( unittest . TestCase ) : <EOL> def test_point ( self ) : <EOL> point = Point ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> point2 = Point ( - <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> self . assertTrue ( point . union ( point2 ) . equals ( point | point2 ) ) <EOL> self . assertTrue ( ( point & point2 ) . is_empty ) <EOL> self . assertTrue ( point . equals ( point - point2 ) ) <EOL> self . assertTrue ( <EOL> point . symmetric_difference ( point2 ) . equals ( point ^ point2 ) ) <EOL> self . assertNotEqual ( point , point2 ) <EOL> point_dupe = Point ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> self . assertEqual ( point , point_dupe ) <EOL> def test_multipoint ( self ) : <EOL> mp1 = MultiPoint ( ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) ) <EOL> mp1_dup = MultiPoint ( ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) ) ) <EOL> mp1_rev = MultiPoint ( ( ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) ) ) <EOL> mp2 = MultiPoint ( ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> mp3 = MultiPoint ( ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:2> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( mp1 , mp1_dup ) <EOL> self . assertNotEqual ( mp1 , mp1_rev ) <EOL> self . assertNotEqual ( mp1 , mp2 ) <EOL> self . assertNotEqual ( mp2 , mp3 ) <EOL> p = Point ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> mp = MultiPoint ( [ ( <NUM_LIT:0> , <NUM_LIT:0> ) ] ) <EOL> self . assertNotEqual ( p , mp ) <EOL> self . assertNotEqual ( mp , p ) <EOL> def test_polygon ( self ) : <EOL> shell = ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:3> , <NUM_LIT:0> ) , ( <NUM_LIT:3> , <NUM_LIT:3> ) , ( <NUM_LIT:0> , <NUM_LIT:3> ) ) <EOL> hole = ( ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:2> , <NUM_LIT:1> ) , ( <NUM_LIT:2> , <NUM_LIT:2> ) , ( <NUM_LIT:1> , <NUM_LIT:2> ) ) <EOL> p_solid = Polygon ( shell ) <EOL> p2_solid = Polygon ( shell ) <EOL> p_hole = Polygon ( shell , holes = [ hole ] ) <EOL> p2_hole = Polygon ( shell , holes = [ hole ] ) <EOL> self . assertEqual ( p_solid , p2_solid ) <EOL> self . assertEqual ( p_hole , p2_hole ) <EOL> self . assertNotEqual ( p_solid , p_hole ) <EOL> shell2 = ( ( - <NUM_LIT:5> , <NUM_LIT:2> ) , ( <NUM_LIT> , <NUM_LIT:3> ) , ( <NUM_LIT:7> , <NUM_LIT:3> ) ) <EOL> p3_hole = Polygon ( shell2 , holes = [ hole ] ) <EOL> self . assertNotEqual ( p_hole , p3_hole ) <EOL> def test_linestring ( self ) : <EOL> line1 = LineString ( [ ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT:2> , <NUM_LIT:2> ) ] ) <EOL> line2 = LineString ( [ ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:2> , <NUM_LIT:2> ) ] ) <EOL> line2_dup = LineString ( [ ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:2> , <NUM_LIT:2> ) ] ) <EOL> self . assertTrue ( line1 . equals ( line2 ) ) <EOL> self . assertNotEqual ( line1 , line2 ) <EOL> self . assertEqual ( line2 , line2_dup ) <EOL> def test_suite ( ) : <EOL> return unittest . TestLoader ( ) . loadTestsFromTestCase ( OperatorsTestCase ) </s>
