Showing with 24 additions and 1 deletion.
  1. +2 −1 tests/src/python/CMakeLists.txt
  2. +22 −0 tests/src/python/test_qgsgeometry.py
3 changes: 2 additions & 1 deletion tests/src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
INCLUDE(UsePythonTest)
ADD_PYTHON_TEST(QGisApp test_qgisapp.py)
ADD_PYTHON_TEST(PyQGisApp test_qgisapp.py)
ADD_PYTHON_TEST(PyQgsGeometry test_qgsgeometry.py)
22 changes: 22 additions & 0 deletions tests/src/python/test_qgsgeometry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import unittest

from qgis.core import (QgsGeometry, QGis)

# Convenience instances in case you may need them
# not used in this test
#from utilities import getQgisTestApp
#QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()

class TestQgsGeometry(unittest.TestCase):

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


if __name__ == '__main__':
unittest.main()