code: def test_ViewBox():
      init_viewbox()
  
      w = vb.geometry().width()
      h = vb.geometry().height()
      view1 = QRectF(0, 0, 10, 10)
      size1 = QRectF(0, h, w, -h)
      assertMapping(vb, view1, size1)
  
      # test resize
      win.resize(400, 400)
      app.processEvents()
      w = vb.geometry().width()
      h = vb.geometry().height()
      size1 = QRectF(0, h, w, -h)
      assertMapping(vb, view1, size1)
  
      # now lock aspect
      vb.setAspectLocked()
  
      # test wide resize
      win.resize(800, 400)
      app.processEvents()
      w = vb.geometry().width()
      h = vb.geometry().height()
      view1 = QRectF(-5, 0, 20, 10)
      size1 = QRectF(0, h, w, -h)
      assertMapping(vb, view1, size1)
  
      # test tall resize
      win.resize(200, 400)
      app.processEvents()
      w = vb.geometry().width()
      h = vb.geometry().height()
      view1 = QRectF(0, -5, 10, 20)
      size1 = QRectF(0, h, w, -h)
      assertMapping(vb, view1, size1)
  
      win.close()
  
imports: import pytest
  import pyqtgraph
label_desc: Use image node_id 3 for calling a global function with example usage: test_ViewBox() without return types