Skip to content

Commit

Permalink
Added from wkbPoint and Polyline tests to python geometry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Aug 3, 2012
1 parent 5ae312c commit 8761bc7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/src/python/test_qgsgeometry.py
@@ -1,6 +1,8 @@
import unittest

from qgis.core import (QgsGeometry, QGis)
from qgis.core import (QgsGeometry,
QgsPoint,
QGis)

# Convenience instances in case you may need them
# not used in this test
Expand All @@ -13,8 +15,20 @@ def testWktPointLoading(self):
myWKT='POINT(10 10)'
myGeometry = QgsGeometry.fromWkt(myWKT)
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
(QGis.Point, myGeometry.type()))
assert myGeometry.type() == QGis.Point, myMessage
(QGis.WKBPoint, myGeometry.type()))
assert myGeometry.wkbType() == QGis.WKBPoint, myMessage

def testFromPoint(self):
myPoint = QgsGeometry.fromPoint(QgsPoint(10, 10))
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
(QGis.WKBPoint, myPoint.type()))
assert myPoint.wkbType() == QGis.WKBPoint, myMessage

def testFromLine(self):
myLine = QgsGeometry.fromPolyline([QgsPoint(1, 1), QgsPoint(2, 2)])
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
(QGis.WKBLineString, myLine.type()))
assert myLine.wkbType() == QGis.WKBLineString, myMessage


if __name__ == '__main__':
Expand Down

0 comments on commit 8761bc7

Please sign in to comment.