Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/npm/tests/test_npm.py
# Copyright (C) 2019-2020 The Software Heritage developers | # Copyright (C) 2019-2021 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import json | import json | ||||
import os | import os | ||||
import pytest | import pytest | ||||
▲ Show 20 Lines • Show All 685 Lines • ▼ Show 20 Lines | def test_npm_no_artifact(swh_config, requests_mock_datadir): | ||||
package = "catify" | package = "catify" | ||||
url = package_url(package) | url = package_url(package) | ||||
loader = NpmLoader(url) | loader = NpmLoader(url) | ||||
actual_load_status = loader.load() | actual_load_status = loader.load() | ||||
assert actual_load_status == { | assert actual_load_status == { | ||||
"status": "failed", | "status": "failed", | ||||
} | } | ||||
assert_last_visit_matches(loader.storage, url, status="partial", type="npm") | assert_last_visit_matches(loader.storage, url, status="failed", type="npm") |