def METHOD_NAME():
    term = pretend.stub()
    request = pretend.stub(
        params={"term": term},
        route_path=pretend.call_recorder(lambda *a, **kw: "/the/path"),
    )
    result = pypi.search(request)
    assert isinstance(result, HTTPMovedPermanently)
    assert result.headers["Location"] == "/the/path"
    assert result.status_code == 301
    assert request.route_path.calls == [pretend.call("search", _query={"q": term})]