5
5
from tests .testcase import BaseTestCase
6
6
from tests .util import with_native_and_http_sessions
7
7
8
+
8
9
@with_native_and_http_sessions
9
10
class GeoPointTestCase (BaseTestCase ):
10
11
table = Table (
@@ -18,7 +19,7 @@ def test_create_table(self):
18
19
self .compile (CreateTable (self .table )),
19
20
'CREATE TABLE test (p Point) ENGINE = Memory'
20
21
)
21
-
22
+
22
23
def test_select_insert (self ):
23
24
a = (10.1 , 12.3 )
24
25
@@ -38,8 +39,6 @@ def test_select_where_point(self):
38
39
self .table .c .p == (10.1 , 12.3 )).scalar (), a )
39
40
40
41
41
-
42
-
43
42
@with_native_and_http_sessions
44
43
class GeoRingTestCase (BaseTestCase ):
45
44
table = Table (
@@ -53,7 +52,7 @@ def test_create_table(self):
53
52
self .compile (CreateTable (self .table )),
54
53
'CREATE TABLE test (r Ring) ENGINE = Memory'
55
54
)
56
-
55
+
57
56
def test_select_insert (self ):
58
57
a = [(0 , 0 ), (10 , 0 ), (10 , 10 ), (0 , 10 )]
59
58
@@ -79,7 +78,8 @@ def test_create_table(self):
79
78
)
80
79
81
80
def test_select_insert (self ):
82
- a = [[(20 , 20 ), (50 , 20 ), (50 , 50 ), (20 , 50 )], [(30 , 30 ), (50 , 50 ), (50 , 30 )]]
81
+ a = [[(20 , 20 ), (50 , 20 ), (50 , 50 ), (20 , 50 )],
82
+ [(30 , 30 ), (50 , 50 ), (50 , 30 )]]
83
83
84
84
with self .create_table (self .table ):
85
85
self .session .execute (self .table .insert (), [{'pg' : a }])
@@ -88,8 +88,6 @@ def test_select_insert(self):
88
88
self .assertEqual (res , a )
89
89
90
90
91
-
92
-
93
91
@with_native_and_http_sessions
94
92
class GeoMultiPolygonTestCase (BaseTestCase ):
95
93
table = Table (
@@ -104,16 +102,13 @@ def test_create_table(self):
104
102
'CREATE TABLE test (mpg MultiPolygon) ENGINE = Memory'
105
103
)
106
104
107
-
108
105
def test_select_insert (self ):
109
- a = [[[(0 , 0 ), (10 , 0 ), (10 , 10 ), (0 , 10 )]], [[(20 , 20 ), (50 , 20 ), (50 , 50 ), (20 , 50 )],[(30 , 30 ), (50 , 50 ), (50 , 30 )]]]
106
+ a = [[[(0 , 0 ), (10 , 0 ), (10 , 10 ), (0 , 10 )]],
107
+ [[(20 , 20 ), (50 , 20 ), (50 , 50 ), (20 , 50 )],
108
+ [(30 , 30 ), (50 , 50 ), (50 , 30 )]]]
110
109
111
110
with self .create_table (self .table ):
112
111
self .session .execute (self .table .insert (), [{'mpg' : a }])
113
112
qres = self .session .query (self .table .c .mpg )
114
113
res = qres .scalar ()
115
114
self .assertEqual (res , a )
116
-
117
-
118
-
119
-
0 commit comments