Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent ce0ac40 commit 69aacde
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion tests/src/core/testqgslayoutmapgrid.cpp
Expand Up @@ -959,7 +959,7 @@ void TestQgsLayoutMapGrid::annotationFormats()
gridProjected.setAnnotationFormat( QgsLayoutItemMapGrid::CustomFormat );
gridProjected.setAnnotationExpression( QStringLiteral( "(@grid_number/10) || case when @grid_axis ='x' then 'a' else 'b' end" ) );
QCOMPARE( gridProjected.gridAnnotationString( 45, QgsLayoutItemMapGrid::Latitude, expressionContext ), QString( "4.5b" ) );
QCOMPARE( gridProjected.gridAnnotationString( 33, QgsLayoutItemMapGrid::Longitude, expressionContext ), QString( "3.3a" ) );
QCOMPARE( gridProjected.gridAnnotationString( 34, QgsLayoutItemMapGrid::Longitude, expressionContext ), QString( "3.4a" ) );
}

void TestQgsLayoutMapGrid::descendingAnnotations()
Expand Down
20 changes: 10 additions & 10 deletions tests/src/python/test_qgslayoutaligner.py
Expand Up @@ -25,7 +25,7 @@
QgsProperty,
QgsLayoutPageCollection,
QgsLayoutMeasurement,
QgsLayoutItemMap,
QgsLayoutItemPicture,
QgsLayoutSize,
QgsLayoutPoint)
from qgis.PyQt.QtCore import Qt, QCoreApplication, QEvent, QPointF, QRectF
Expand All @@ -44,15 +44,15 @@ def testAlign(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
item1.attemptMove(QgsLayoutPoint(4, 8, QgsUnitTypes.LayoutMillimeters))
item1.attemptResize(QgsLayoutSize(18, 12, QgsUnitTypes.LayoutMillimeters))
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
item2.attemptMove(QgsLayoutPoint(6, 10, QgsUnitTypes.LayoutMillimeters))
item2.attemptResize(QgsLayoutSize(10, 9, QgsUnitTypes.LayoutMillimeters))
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.attemptMove(QgsLayoutPoint(0.8, 1.2, QgsUnitTypes.LayoutCentimeters))
item3.attemptResize(QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters))
l.addItem(item3)
Expand Down Expand Up @@ -110,15 +110,15 @@ def testDistribute(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
item1.attemptMove(QgsLayoutPoint(4, 8, QgsUnitTypes.LayoutMillimeters))
item1.attemptResize(QgsLayoutSize(18, 12, QgsUnitTypes.LayoutMillimeters))
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
item2.attemptMove(QgsLayoutPoint(7, 10, QgsUnitTypes.LayoutMillimeters))
item2.attemptResize(QgsLayoutSize(10, 9, QgsUnitTypes.LayoutMillimeters))
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.attemptMove(QgsLayoutPoint(0.8, 1.2, QgsUnitTypes.LayoutCentimeters))
item3.attemptResize(QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters))
l.addItem(item3)
Expand Down Expand Up @@ -193,15 +193,15 @@ def testResize(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
item1.attemptMove(QgsLayoutPoint(4, 8, QgsUnitTypes.LayoutMillimeters))
item1.attemptResize(QgsLayoutSize(18, 12, QgsUnitTypes.LayoutMillimeters))
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
item2.attemptMove(QgsLayoutPoint(7, 10, QgsUnitTypes.LayoutMillimeters))
item2.attemptResize(QgsLayoutSize(10, 9, QgsUnitTypes.LayoutMillimeters))
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.attemptMove(QgsLayoutPoint(0.8, 1.2, QgsUnitTypes.LayoutCentimeters))
item3.attemptResize(QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters))
l.addItem(item3)
Expand Down
56 changes: 28 additions & 28 deletions tests/src/python/test_qgslayoutview.py
Expand Up @@ -17,7 +17,7 @@
from qgis.core import (QgsProject,
QgsLayout,
QgsUnitTypes,
QgsLayoutItemMap,
QgsLayoutItemPicture,
QgsLayoutPoint,
QgsLayoutSize,
QgsLayoutAligner)
Expand Down Expand Up @@ -83,11 +83,11 @@ def testSelectAll(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.setLocked(True)
l.addItem(item3)

Expand Down Expand Up @@ -117,11 +117,11 @@ def testDeselectAll(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.setLocked(True)
l.addItem(item3)

Expand Down Expand Up @@ -153,11 +153,11 @@ def testInvertSelection(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.setLocked(True)
l.addItem(item3)

Expand Down Expand Up @@ -187,11 +187,11 @@ def testSelectNextByZOrder(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.setLocked(True)
l.addItem(item3)

Expand Down Expand Up @@ -262,11 +262,11 @@ def testLockActions(self):
view.setCurrentLayout(l)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
l.addItem(item3)

item1.setLocked(True)
Expand Down Expand Up @@ -296,11 +296,11 @@ def testStacking(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
l.addLayoutItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
l.addLayoutItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
l.addLayoutItem(item3)

view = QgsLayoutView()
Expand Down Expand Up @@ -415,15 +415,15 @@ def testAlign(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
item1.attemptMove(QgsLayoutPoint(4, 8, QgsUnitTypes.LayoutMillimeters))
item1.attemptResize(QgsLayoutSize(18, 12, QgsUnitTypes.LayoutMillimeters))
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
item2.attemptMove(QgsLayoutPoint(6, 10, QgsUnitTypes.LayoutMillimeters))
item2.attemptResize(QgsLayoutSize(10, 9, QgsUnitTypes.LayoutMillimeters))
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.attemptMove(QgsLayoutPoint(0.8, 1.2, QgsUnitTypes.LayoutCentimeters))
item3.attemptResize(QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters))
l.addItem(item3)
Expand Down Expand Up @@ -490,15 +490,15 @@ def testDistribute(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
item1.attemptMove(QgsLayoutPoint(4, 8, QgsUnitTypes.LayoutMillimeters))
item1.attemptResize(QgsLayoutSize(18, 12, QgsUnitTypes.LayoutMillimeters))
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
item2.attemptMove(QgsLayoutPoint(7, 10, QgsUnitTypes.LayoutMillimeters))
item2.attemptResize(QgsLayoutSize(10, 9, QgsUnitTypes.LayoutMillimeters))
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.attemptMove(QgsLayoutPoint(0.8, 1.2, QgsUnitTypes.LayoutCentimeters))
item3.attemptResize(QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters))
l.addItem(item3)
Expand Down Expand Up @@ -582,15 +582,15 @@ def testResize(self):
l = QgsLayout(p)

# add some items
item1 = QgsLayoutItemMap(l)
item1 = QgsLayoutItemPicture(l)
item1.attemptMove(QgsLayoutPoint(4, 8, QgsUnitTypes.LayoutMillimeters))
item1.attemptResize(QgsLayoutSize(18, 12, QgsUnitTypes.LayoutMillimeters))
l.addItem(item1)
item2 = QgsLayoutItemMap(l)
item2 = QgsLayoutItemPicture(l)
item2.attemptMove(QgsLayoutPoint(7, 10, QgsUnitTypes.LayoutMillimeters))
item2.attemptResize(QgsLayoutSize(10, 9, QgsUnitTypes.LayoutMillimeters))
l.addItem(item2)
item3 = QgsLayoutItemMap(l)
item3 = QgsLayoutItemPicture(l)
item3.attemptMove(QgsLayoutPoint(0.8, 1.2, QgsUnitTypes.LayoutCentimeters))
item3.attemptResize(QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters))
l.addItem(item3)
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 69aacde

Please sign in to comment.