Skip to content

Commit d8e918d

Browse files
committedAug 2, 2012
Renamed app test with py prefix and added simple geometry test case
1 parent ec87f7f commit d8e918d

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
 

‎tests/src/python/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
INCLUDE(UsePythonTest)
2-
ADD_PYTHON_TEST(QGisApp test_qgisapp.py)
2+
ADD_PYTHON_TEST(PyQGisApp test_qgisapp.py)
3+
ADD_PYTHON_TEST(PyQgsGeometry test_qgsgeometry.py)

‎tests/src/python/test_qgsgeometry.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import unittest
2+
3+
from qgis.core import (QgsGeometry, QGis)
4+
5+
# Convenience instances in case you may need them
6+
# not used in this test
7+
#from utilities import getQgisTestApp
8+
#QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()
9+
10+
class TestQgsGeometry(unittest.TestCase):
11+
12+
def testWktPointLoading(self):
13+
myWKT='POINT(10 10)'
14+
myGeometry = QgsGeometry.fromWkt(myWKT)
15+
myMessage = ('Expected:\n%s\nGot:\n%s\n' %
16+
(QGis.Point, myGeometry.type()))
17+
assert myGeometry.type() == QGis.Point, myMessage
18+
19+
20+
if __name__ == '__main__':
21+
unittest.main()
22+

0 commit comments

Comments
 (0)
Please sign in to comment.