def test_panzoom_constraints_x():
    pz = PanZoom()
    pz.xmin, pz.xmax = -2, 2

    # Pan beyond the bounds.
    pz.pan_delta((-2, 2))
    assert pz.pan == [-1, 2]
    pz.reset()

    # Zoom beyond the bounds.
    pz.zoom_delta((-1, -2))
    assert pz.pan == [0, 0]
    assert pz.zoom[0] == .5
    assert pz.zoom[1] < .5
dataset/ETHPy150Open kwikteam/phy/phy/plot/tests/test_panzoom.py/test_panzoom_constraints_x/original