diff --git a/requirements-test.txt b/requirements-test.txt index 6355048..78bd023 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,9 +1,7 @@ pytest aioresponses pytest_asyncio pytest_flask swh.core[testing-core] swh.model[testing] -swh.storage[testing] -swh.web[testing] asynctest diff --git a/swh/scanner/tests/flask_api.py b/swh/scanner/tests/flask_api.py index 2ab5945..cdcd212 100644 --- a/swh/scanner/tests/flask_api.py +++ b/swh/scanner/tests/flask_api.py @@ -1,36 +1,36 @@ # Copyright (C) 2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information from flask import Flask, request -from swh.web.common.exc import LargePayloadExc +from swh.scanner.exceptions import LargePayloadExc from .data import present_swhids def create_app(): app = Flask(__name__) @app.route("/") def index(): return "SWH scanner API" @app.route("/known/", methods=["POST"]) def known(): swhids = request.get_json() if len(swhids) > 900: raise LargePayloadExc( "The maximum number of SWHIDs this endpoint can receive is 900" ) res = {swhid: {"known": False} for swhid in swhids} for swhid in swhids: if swhid in present_swhids: res[swhid]["known"] = True return res return app