mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Added from wkbPoint and Polyline tests to python geometry tests
This commit is contained in:
parent
5ae312cfad
commit
8761bc7730
@ -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 @@ class TestQgsGeometry(unittest.TestCase):
|
||||
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__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user