Skip to content
Permalink
Browse files

Update zoom tests to reflect new rect extents

  • Loading branch information...
geographika committed Oct 10, 2018
1 parent a64ef13 commit d7990027a1ac3ab7de7bf3aa291f6569f994eaff
Showing with 11 additions and 7 deletions.
  1. +11 −7 mapscript/python/tests/cases/zoom_test.py
@@ -125,18 +125,20 @@ def testZoomRectangleBadly(self):

class ZoomScaleTestCase(MapZoomTestCase):

def xtestRecenter(self):
def testRecenter(self):
"""ZoomScaleTestCase.testRecenter: recentering map returns proper extent"""
w, h = (self.mapobj1.width, self.mapobj1.height)
w, h = (self.mapobj1.width, self.mapobj1.height) # 100 by 100
p = mapscript.pointObj()
p.x, p.y = (50, 50)
scale = 2834.6472
extent = self.mapobj1.extent
self.mapobj1.zoomScale(scale, p, w, h, extent, None)
assert self.mapobj1.scaledenom == scale
new_extent = self.mapobj1.extent
self.assertRectsEqual(new_extent, mapscript.rectObj(-50, -50, 50, 50))
# self.assertRectsEqual(new_extent, mapscript.rectObj(-50, -50, 50, 50)) # old values
self.assertRectsEqual(new_extent, mapscript.rectObj(-49.5, -49.5, 49.5, 49.5))

def xtestZoomInScale(self):
def testZoomInScale(self):
"""ZoomScaleTestCase.testZoomInScale: zooming in to a specified scale returns proper extent"""
w, h = (self.mapobj1.width, self.mapobj1.height)
p = mapscript.pointObj()
@@ -145,9 +147,10 @@ def xtestZoomInScale(self):
extent = self.mapobj1.extent
self.mapobj1.zoomScale(scale, p, w, h, extent, None)
new_extent = self.mapobj1.extent
self.assertRectsEqual(new_extent, mapscript.rectObj(-25, -25, 25, 25))
# self.assertRectsEqual(new_extent, mapscript.rectObj(-25, -25, 25, 25)) # old values
self.assertRectsEqual(new_extent, mapscript.rectObj(-24.75, -24.75, 24.75, 24.75))

def xtestZoomOutScale(self):
def testZoomOutScale(self):
"""ZoomScaleTestCase.testZoomOutScale: zooming out to a specified scale returns proper extent"""
w, h = (self.mapobj1.width, self.mapobj1.height)
p = mapscript.pointObj()
@@ -156,7 +159,8 @@ def xtestZoomOutScale(self):
extent = self.mapobj1.extent
self.mapobj1.zoomScale(scale, p, w, h, extent, None)
new_extent = self.mapobj1.extent
self.assertRectsEqual(new_extent, mapscript.rectObj(-100, -100, 100, 100))
# self.assertRectsEqual(new_extent, mapscript.rectObj(-100, -100, 100, 100)) # old values
self.assertRectsEqual(new_extent, mapscript.rectObj(-99, -99, 99, 99))

def testZoomOutPointConstrained(self):
"""ZoomScaleTestCase.testZoomOutPointConstrained: zooming out to a constrained extent returns proper extent"""

0 comments on commit d799002

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