linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Tests - new feature dialog lat/lon not mapped thourght to form consistently #149

Closed SPlanzer closed 4 years ago

SPlanzer commented 4 years ago

The below triggering of the new feature dialog and subsequent loading of the new feature html view gives different lat/long values each time.

x = 169.82699229328563
y = -44.200093724057346
widget = iface.mapCanvas().viewport()
canvas_point = QgsMapTool(iface.mapCanvas()).toCanvasCoordinates
QTest.mouseClick(
    widget, Qt.LeftButton, pos=canvas_point(QgsPointXY(x, y)), delay=0
)

For example inputting the same values in twice populated the form with the two below results

Longitude/latitude: 169 49 36.4E 44 12 01.3S (169.826768 -44.200349)

NZTM: 1346442.8 5100976.8

and

Longitude/latitude: 169 49 38.3E 44 12 01.0S (169.827315 -44.200291)

NZTM: 1346486.3 5100984.8
SPlanzer commented 4 years ago

As we are not testing QGIS functionality and assume it to be working correctly this has been solved by the tests passing the correct coordinates to the NZGB application and ensuring the are as expected through application operation.