Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Renamed app test with py prefix and added simple geometry test case
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|