def METHOD_NAME(agent_plugin_service, flask_client, error):
    agent_plugin_service.install_plugin_archive = MagicMock(side_effect=error)
    resp = flask_client.put(
        get_url_for_resource(InstallAgentPlugin),
        data=AGENT_PLUGIN,
        follow_redirects=True,
    )
    assert resp.status_code == HTTPStatus.INTERNAL_SERVER_ERROR