Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 7, 2017
1 parent 3fd2e09 commit 14546ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/python/test_qgslayoutsnapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def testSnapPointToGuides(self):
point, snapped = s.snapPointToGuides(0.5, QgsLayoutGuide.Vertical, 1)
self.assertFalse(snapped)

guides.addGuide(QgsLayoutGuide(QgsLayoutGuide.Vertical, QgsLayoutMeasurement(1)))
guides.addGuide(QgsLayoutGuide(QgsLayoutGuide.Vertical, QgsLayoutMeasurement(1), page))
point, snapped = s.snapPointToGuides(0.5, QgsLayoutGuide.Vertical, 1)
self.assertTrue(snapped)
self.assertEqual(point, 1)
Expand All @@ -153,7 +153,7 @@ def testSnapPointToGuides(self):
# snap to hoz
point, snapped = s.snapPointToGuides(0.5, QgsLayoutGuide.Horizontal, 1)
self.assertFalse(snapped)
guides.addGuide(QgsLayoutGuide(QgsLayoutGuide.Horizontal, QgsLayoutMeasurement(1)))
guides.addGuide(QgsLayoutGuide(QgsLayoutGuide.Horizontal, QgsLayoutMeasurement(1), page))
point, snapped = s.snapPointToGuides(0.5, QgsLayoutGuide.Horizontal, 1)
self.assertTrue(snapped)
self.assertEqual(point, 1)
Expand Down Expand Up @@ -188,7 +188,7 @@ def testSnapPoint(self):
# test that guide takes precedence
s.setSnapToGrid(True)
s.setSnapToGuides(True)
guides.addGuide(QgsLayoutGuide(QgsLayoutGuide.Horizontal, QgsLayoutMeasurement(0.5)))
guides.addGuide(QgsLayoutGuide(QgsLayoutGuide.Horizontal, QgsLayoutMeasurement(0.5), page))
point, snapped = s.snapPoint(QPointF(1, 1), 1)
self.assertTrue(snapped)
self.assertEqual(point, QPointF(0, 0.5))
Expand Down

0 comments on commit 14546ec

Please sign in to comment.