def test_panzoom_zoom_mouse(qtbot, canvas_pz, panzoom):
    c = canvas_pz
    pz = panzoom

    # Zoom with mouse.
    press = MouseEvent(type='mouse_press', pos=(50., 50.))
    c.events.mouse_move(pos=(0., 0.), button=2,
                        last_event=press, press_event=press)
    assert pz.pan[0] < 0
    assert pz.pan[1] < 0
    assert pz.zoom[0] < 1
    assert pz.zoom[1] > 1
    pz.reset()

    # Zoom with mouse.
    size = np.asarray(c.size)
    c.events.mouse_wheel(pos=size / 2., delta=(0., 1.))
    assert pz.pan == [0, 0]
    assert pz.zoom[0] > 1
    assert pz.zoom[1] > 1
    pz.reset()

    # Using modifiers with the wheel should not zoom.
    c.events.mouse_wheel(pos=(0., 0.), delta=(0., 1.),
                         modifiers=(keys.CONTROL,))
    assert pz.pan == [0, 0]
    assert pz.zoom == [1, 1]
    pz.reset()
dataset/ETHPy150Open kwikteam/phy/phy/plot/tests/test_panzoom.py/test_panzoom_zoom_mouse/original