Skip to content
Permalink
Browse files

Added from wkbPoint and Polyline tests to python geometry tests

  • Loading branch information
timlinux committed Aug 3, 2012
1 parent 5ae312c commit 8761bc773099d4900893cbcb375ca9aaa647d032
Showing with 17 additions and 3 deletions.
  1. +17 −3 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
@@ -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__':

0 comments on commit 8761bc7

Please sign in to comment.
You can’t perform that action at this time.