code: def test_zoom_limit():
      """Test zooming with X and Y limits set"""
      vb = pg.ViewBox()
      vb.setLimits(xMin=0, xMax=10, yMin=0, yMax=10)
  
      # Try zooming within limits. Should return unmodified
      testRange = pg.QtCore.QRect(0, 0, 9, 9)
      vb.setRange(testRange, padding=0)
      vbViewRange = vb.getState()["viewRange"]
      assert vbViewRange == [
          [testRange.left(), testRange.right()],
          [testRange.top(), testRange.bottom()],
      ]
  
      # And outside limits. both view range and targetRange should be set to limits
      testRange = pg.QtCore.QRect(-5, -5, 16, 20)
      vb.setRange(testRange, padding=0)
  
      expected = [[0, 10], [0, 10]]
      vbState = vb.getState()
  
      assert vbState["targetRange"] == expected
      assert vbState["viewRange"] == expected
  
file_path: pyqtgraph/tests/graphicsItems/ViewBox/test_ViewBoxZoom.py
imports: import pyqtgraph
label_desc: Use image node_id 2 for calling a global function with example usage: test_zoom_limit() without return types