Skip to content

Commit 118e085

Browse files
author
Devon Tucker
committed
Update test cases to work with GeoTools 21+
1 parent 9045355 commit 118e085

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

geoscript/function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import java
88
import weakref
99
import inspect
10-
from org.geotools.factory import FactoryIteratorProvider, CommonFactoryFinder
11-
from org.geotools.factory import GeoTools
10+
from org.geotools.factory import CommonFactoryFinder
11+
from org.geotools.util.factory import FactoryIteratorProvider, GeoTools
1212
from org.geotools.filter import FunctionFactory, FunctionExpressionImpl
1313

1414
_factory = CommonFactoryFinder.getFilterFactory(None)

geoscript/geom/circularring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CircularRing(_CircularRing):
1212
*coords* is a variable list of ``list``/``tuple`` arguments.
1313
1414
>>> CircularRing([1,1], [5,5], [2,2], [4,5], [1,1])
15-
CIRCULARSTRING(1.0 1.0, 5.0 5.0, 2.0 2.0, 4.0 5.0, 1.0 1.0)
15+
CIRCULARSTRING (1.0 1.0, 5.0 5.0, 2.0 2.0, 4.0 5.0, 1.0 1.0)
1616
"""
1717

1818
def __init__(self, *coords):

geoscript/geom/circularstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CircularString(_CircularString):
1212
*coords* is a variable list of ``list``/``tuple`` arguments.
1313
1414
>>> CircularString([1,1], [5,5], [2,2])
15-
CIRCULARSTRING(1.0 1.0, 5.0 5.0, 2.0 2.0)
15+
CIRCULARSTRING (1.0 1.0, 5.0 5.0, 2.0 2.0)
1616
"""
1717

1818
def __init__(self, *coords):

geoscript/geom/compoundcurve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CompoundCurve(_CompoundCurve):
1414
*linestrings* is a variable list of ``LineStrings`` or ``CircularStrings`` arguments.
1515
1616
>>> CompoundCurve(CircularString([10.0, 10.0], [0.0, 20.0], [-10.0, 10.0]), LineString([-10.0, 10.0], [-10.0, 0.0], [10.0, 0.0], [5.0, 5.0]))
17-
COMPOUNDCURVE(CIRCULARSTRING(10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 5.0 5.0))
17+
COMPOUNDCURVE (CIRCULARSTRING (10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 5.0 5.0))
1818
"""
1919

2020
def __init__(self, *linestrings):

geoscript/geom/compoundring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CompoundRing(_CompoundRing):
1414
*linestrings* is a variable list of ``LineStrings`` or ``CircularStrings`` arguments.
1515
1616
>>> CompoundRing(CircularString([10.0, 10.0], [0.0, 20.0], [-10.0, 10.0]),LineString([-10.0, 10.0], [-10.0, 0.0], [10.0, 0.0], [10.0, 10.0]))
17-
COMPOUNDCURVE(CIRCULARSTRING(10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 10.0 10.0))
17+
COMPOUNDCURVE (CIRCULARSTRING (10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 10.0 10.0))
1818
"""
1919

2020
def __init__(self, *linestrings):

geoscript/geom/io/gml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def writeGML(g, ver=2, format=True, xmldecl=False):
1313
1414
>>> from geoscript.geom import Point
1515
>>> writeGML(Point(1,2), format=False)
16-
u'<gml:Point xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml"><gml:coord><gml:X>1.0</gml:X><gml:Y>2.0</gml:Y></gml:coord></gml:Point>'
16+
u'<gml:Point xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink"><gml:coord><gml:X>1.0</gml:X><gml:Y>2.0</gml:Y></gml:coord></gml:Point>'
1717
"""
1818
el = g.getGeometryType()
1919

geoscript/style/io/sld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from geoscript import util
3-
from org.geotools.styling import SLDTransformer
3+
from org.geotools.xml.styling import SLDTransformer
44

55
def writeSLD(style, out=sys.stdout, format=True):
66
tx = SLDTransformer()

geoscript/workspace/workspace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def layers(self):
4848
>>> l1 = ws.create('foo')
4949
>>> l2 = ws.create('bar')
5050
>>> ws.layers()
51-
['foo', 'bar']
51+
['bar', 'foo']
5252
"""
5353

5454
return [str(tn) for tn in self._store.typeNames]
@@ -99,7 +99,7 @@ def create(self, name=None, fields=[('geom', geom.Geometry,'epsg:4326')], schema
9999
>>> from geoscript.feature import Schema
100100
>>> l2 = ws.create(schema=Schema('bar', [('geom', geom.Point)]))
101101
>>> ws.layers()
102-
['foo', 'bar']
102+
['bar', 'foo']
103103
"""
104104

105105
if not name:

tests/test_feature.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
except ImportError:
88
import simplejson as json
99

10-
class Feature_Test:
10+
class Feature_Test(unittest.TestCase):
1111

1212
@classmethod
1313
def setUpClass(cls):
@@ -197,7 +197,7 @@ def testWriteGML3(self):
197197
assert u'1' in xp.findvalues('//gsf:x', doc)
198198
assert u'1.1' in xp.findvalues('//gsf:y', doc)
199199
assert u'one' in xp.findvalues('//gsf:z', doc)
200-
assert u'-125.0 50.0' in xp.findvalues('//gsf:geom/gml:Point/gml:pos', doc)
200+
self.assertIn(u'-125 50', xp.findvalues('//gsf:geom/gml:Point/gml:pos', doc))
201201

202202
def testWriteGML32(self):
203203
g = geom.Point(-125, 50)
@@ -211,5 +211,5 @@ def testWriteGML32(self):
211211
assert u'1' in xp.findvalues('//gsf:x', doc)
212212
assert u'1.1' in xp.findvalues('//gsf:y', doc)
213213
assert u'one' in xp.findvalues('//gsf:z', doc)
214-
assert u'-125.0 50.0' in xp.findvalues('//gsf:geom/gml:Point/gml:pos', doc)
214+
self.assertIn(u'-125 50', xp.findvalues('//gsf:geom/gml:Point/gml:pos', doc))
215215

tests/test_geom.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ def testMultiPolygon(self):
5858

5959
def testCircularString(self):
6060
cs = geom.CircularString([6.12, 10.0],[7.07, 7.07],[10.0, 0.0])
61-
self.assertEqual('CIRCULARSTRING(6.12 10.0, 7.07 7.07, 10.0 0.0)', str(cs))
61+
self.assertEqual('CIRCULARSTRING (6.12 10.0, 7.07 7.07, 10.0 0.0)', str(cs))
6262

6363
def testCircularRing(self):
6464
cr = geom.CircularRing( [2.0, 1.0], [1.0, 2.0], [0.0, 1.0], [1.0, 0.0], [2.0, 1.0])
65-
self.assertEqual('CIRCULARSTRING(2.0 1.0, 1.0 2.0, 0.0 1.0, 1.0 0.0, 2.0 1.0)', str(cr))
65+
self.assertEqual('CIRCULARSTRING (2.0 1.0, 1.0 2.0, 0.0 1.0, 1.0 0.0, 2.0 1.0)', str(cr))
6666

6767
def testCompoundCurve(self):
6868
cc = geom.CompoundCurve(
6969
geom.CircularString([10.0, 10.0], [0.0, 20.0], [-10.0, 10.0]),
7070
geom.LineString([-10.0, 10.0], [-10.0, 0.0], [10.0, 0.0], [5.0, 5.0])
7171
)
72-
self.assertEqual('COMPOUNDCURVE(CIRCULARSTRING(10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 5.0 5.0))', str(cc))
72+
self.assertEqual('COMPOUNDCURVE (CIRCULARSTRING (10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 5.0 5.0))', str(cc))
7373

7474
def testCompoundRing(self):
7575
cc = geom.CompoundRing(
7676
geom.CircularString([10.0, 10.0], [0.0, 20.0], [-10.0, 10.0]),
7777
geom.LineString([-10.0, 10.0], [-10.0, 0.0], [10.0, 0.0], [10.0, 10.0])
7878
)
79-
self.assertEqual('COMPOUNDCURVE(CIRCULARSTRING(10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 10.0 10.0))', str(cc))
79+
self.assertEqual('COMPOUNDCURVE (CIRCULARSTRING (10.0 10.0, 0.0 20.0, -10.0 10.0), (-10.0 10.0, -10.0 0.0, 10.0 0.0, 10.0 10.0))', str(cc))
8080

8181
def testBounds(self):
8282
b = geom.Bounds(1.0, 2.0, 3.0, 4.0)

0 commit comments

Comments
 (0)