Skip to content
Permalink
Browse files

Fix failing tests

  • Loading branch information
nyalldawson committed Oct 24, 2017
1 parent ce0ac40 commit 69aacde19cf346096aa2ce744015d179dfd0916a
@@ -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()
@@ -25,7 +25,7 @@
QgsProperty,
QgsLayoutPageCollection,
QgsLayoutMeasurement,
QgsLayoutItemMap,
QgsLayoutItemPicture,
QgsLayoutSize,
QgsLayoutPoint)
from qgis.PyQt.QtCore import Qt, QCoreApplication, QEvent, QPointF, QRectF
@@ -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)
@@ -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)
@@ -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)
@@ -17,7 +17,7 @@
from qgis.core import (QgsProject,
QgsLayout,
QgsUnitTypes,
QgsLayoutItemMap,
QgsLayoutItemPicture,
QgsLayoutPoint,
QgsLayoutSize,
QgsLayoutAligner)
@@ -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)

@@ -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)

@@ -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)

@@ -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)

@@ -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)
@@ -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()
@@ -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)
@@ -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)
@@ -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)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 69aacde

Please sign in to comment.
You can’t perform that action at this time.